Upgrade OkHttp to 5.0.0 and Kotlin to 2.2.0 and removed @ignore testcases.#911
Upgrade OkHttp to 5.0.0 and Kotlin to 2.2.0 and removed @ignore testcases.#911utkrishtsahu wants to merge 5 commits intov4_developmentfrom
Conversation
which causes NullPointerException at OpenSSLKey.java:242 when handling RSA keys created from PEM/PKCS8 specs.
There was a problem hiding this comment.
Pull request overview
This PR upgrades the SDK's internal dependencies: OkHttp from 4.12.0 to 5.0.0 and Kotlin from 2.0.21 to 2.2.0. The OkHttp 5.x upgrade requires Kotlin 2.2.0+ for metadata compatibility. The changes are primarily internal with no impact on the public API.
Changes:
- Upgraded Kotlin compiler from 2.0.21 to 2.2.0
- Upgraded OkHttp from 4.12.0 to 5.0.0
- Migrated test infrastructure from
okhttp3.mockwebservertomockwebserver3package - Replaced deprecated
toLowerCase()withlowercase()in internal code - Re-enabled 2 previously @ignore'd tests in WebAuthProviderTest.kt
- Updated V4_MIGRATION_GUIDE.md with Kotlin 2.2.0 and OkHttp 5.0.0 upgrade notes
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| build.gradle | Updated Kotlin version to 2.2.0 |
| auth0/build.gradle | Updated OkHttp version to 5.0.0 and mockwebserver dependency to mockwebserver3 |
| auth0/src/main/java/com/auth0/android/provider/WebAuthProvider.kt | Replaced toLowerCase(Locale.ROOT) with lowercase(Locale.ROOT) |
| auth0/src/main/java/com/auth0/android/request/internal/OidcUtils.kt | Replaced toLowerCase(Locale.ROOT) with lowercase(Locale.ROOT) |
| auth0/src/test/java/com/auth0/android/request/internal/ThreadSwitcherShadow.java | Added mainThread() method implementation to match ThreadSwitcher interface |
| auth0/src/test/java/com/auth0/android/util/SSLTestUtils.kt | Removed tunnelProxy parameter from useHttps() call (OkHttp 5.x API change) |
| auth0/src/test/java/com/auth0/android/util/APIMockServer.kt | Migrated to mockwebserver3 package and MockResponse.Builder() pattern |
| auth0/src/test/java/com/auth0/android/util/AuthenticationAPIMockServer.kt | Updated to use MockResponse.Builder() pattern |
| auth0/src/test/java/com/auth0/android/request/DefaultClientTest.kt | Migrated to mockwebserver3 API (request.target, request.headers[], request.body?.utf8()) |
| auth0/src/test/java/com/auth0/android/provider/WebAuthProviderTest.kt | Re-enabled 2 tests with @ConscryptMode annotation and updated to use mocked networking clients |
| auth0/src/test/java/com/auth0/android/authentication/AuthenticationAPIClientTest.kt | Migrated to mockwebserver3 API changes |
| auth0/src/test/java/com/auth0/android/authentication/MfaApiClientTest.kt | Migrated to mockwebserver3 API changes |
| auth0/src/test/java/com/auth0/android/management/UsersAPIClientTest.kt | Migrated to mockwebserver3 API changes |
| auth0/src/test/java/com/auth0/android/myaccount/MyAccountAPIClientTest.kt | Migrated to mockwebserver3 API changes |
| V4_MIGRATION_GUIDE.md | Added Kotlin 2.2.0 and OkHttp 5.0.0 upgrade documentation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
| ``` | ||
|
|
||
| > **Note:** Kotlin 2.2.0 promotes the deprecation of `String.toLowerCase()` / `String.toUpperCase()` without a `Locale` parameter to an error. If your project uses these methods, replace them with `lowercase(Locale.ROOT)` / `uppercase(Locale.ROOT)`. |
There was a problem hiding this comment.
nit: We could remove this note, I think this note applies to users who have to update kotlin version and they may have more breaking changes in their code base to implement along with this while upgrading.https://kotlinlang.org/docs/compatibility-guide-22.html thoughts on this . or we could also add official doc for Kotlin 2.2.x for how to upgrade instead
Changes
Internal dependency upgrade
This PR upgrades the SDK's internal HTTP client library OkHttp from 4.12.0 to 5.0.0 and the Kotlin compiler from 2.0.21 to 2.2.0 (required for OkHttp 5.x metadata compatibility).
Endpoints added, deleted, deprecated, or changed
None. All Auth0 API endpoints remain unchanged.
Classes and methods added, deleted, deprecated, or changed
Test infrastructure migration
References
SDK-7768
Testing
Build Passed
Unit Test Passed
Checklist
I have read the Auth0 general contribution guidelines
I have read the Auth0 Code of Conduct
All existing and new tests complete without errors