Upgrade OkHttp to 5.0.0 and Kotlin to 2.2.0 and removed @ignore testcases.(Re pushed)#913
Upgrade OkHttp to 5.0.0 and Kotlin to 2.2.0 and removed @ignore testcases.(Re pushed)#913utkrishtsahu wants to merge 5 commits intov4_developmentfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR upgrades the SDK's internal dependencies to their latest major versions: OkHttp from 4.12.0 to 5.0.0 and Kotlin from 2.0.21 to 2.2.0. The upgrade is primarily internal and does not affect the SDK's public API surface, as OkHttp is used as an implementation dependency. The changes include comprehensive test infrastructure migration to OkHttp 5.x's new APIs, replacement of deprecated Kotlin string methods, and re-enabling of two previously ignored test cases that now pass with the updated dependencies.
Changes:
- Upgraded Kotlin compiler from 2.0.21 to 2.2.0 and OkHttp from 4.12.0 to 5.0.0
- Migrated test infrastructure from
okhttp3.mockwebservertomockwebserver3package with corresponding API updates - Replaced deprecated
toLowerCase(Locale.ROOT)withlowercase(Locale.ROOT)in production code - Re-enabled 2 previously ignored tests in WebAuthProviderTest with
@ConscryptMode(OFF)annotation - Added
mainThread()implementation to ThreadSwitcherShadow for test completeness - Updated V4_MIGRATION_GUIDE.md with Kotlin 2.2.0 and OkHttp 5.0.0 upgrade details
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 from 2.0.21 to 2.2.0 |
| auth0/build.gradle | Updated OkHttp version from 4.12.0 to 5.0.0 and test dependency to mockwebserver3 |
| auth0/src/main/java/com/auth0/android/provider/WebAuthProvider.kt | Replaced deprecated toLowerCase() with lowercase() in scheme validation |
| auth0/src/main/java/com/auth0/android/request/internal/OidcUtils.kt | Replaced deprecated toLowerCase() with lowercase() in scope normalization |
| auth0/src/test/java/com/auth0/android/util/SSLTestUtils.kt | Updated MockWebServer import and removed second parameter from useHttps() |
| auth0/src/test/java/com/auth0/android/util/APIMockServer.kt | Migrated to MockResponse.Builder pattern, RecordedRequest.target, and server.close() |
| auth0/src/test/java/com/auth0/android/util/AuthenticationAPIMockServer.kt | Migrated to MockResponse.Builder pattern for empty and plain text responses |
| auth0/src/test/java/com/auth0/android/request/internal/ThreadSwitcherShadow.java | Added mainThread() shadow implementation for test coverage |
| auth0/src/test/java/com/auth0/android/request/DefaultClientTest.kt | Updated imports, MockResponse.Builder pattern, RecordedRequest.target, body?.utf8() null safety |
| auth0/src/test/java/com/auth0/android/provider/WebAuthProviderTest.kt | Removed @ignore from 2 tests, added @ConscryptMode(OFF), replaced mock server with spy pattern |
| auth0/src/test/java/com/auth0/android/myaccount/MyAccountAPIClientTest.kt | Updated RecordedRequest.target and headers[] access, body!!.utf8() |
| auth0/src/test/java/com/auth0/android/management/UsersAPIClientTest.kt | Updated RecordedRequest.target and headers[] access, body!!.utf8() |
| auth0/src/test/java/com/auth0/android/authentication/MfaApiClientTest.kt | Updated imports, MockResponse.Builder pattern, RecordedRequest.target, headers[], body!!.utf8() |
| auth0/src/test/java/com/auth0/android/authentication/AuthenticationAPIClientTest.kt | Updated imports, RecordedRequest.target, headers[], body!!.utf8() throughout all tests |
| V4_MIGRATION_GUIDE.md | Added Kotlin 2.2.0 and OkHttp 5.0.0 upgrade notes with migration guidance |
💡 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 can drop this message as there might be more changes that need to be incorporated by clients tp upgrade their code base to kotline 2..20 and instead we can add a kotlin official documentaion on how to upgrade from older to 2.2.x
0a98d21 to
5e3b605
Compare
…server3 T_EDITOR=true git rebase --continue 2>&1 TOR=true GIT_SEQUENCE_EDITOR=true git rebase --continue 2>&1 T_EDITOR="cat" git rebase --continue --no-edit 2>&1
which causes NullPointerException at OpenSSLKey.java:242 when handling RSA keys created from PEM/PKCS8 specs.
5e3b605 to
2a29eb5
Compare
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