Conversation
📝 WalkthroughWalkthroughAdds JSON test asset fixtures (minimal and full OIDC configurations) and Android instrumentation test suites for the ChangesDaVinci and OidcDeviceClient JSON Config Tests
Journey and OidcWebClient JSON Config Tests
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
davinci/src/androidTest/kotlin/com/pingidentity/davinci/OidcDeviceClientJsonConfigTest.kt (1)
53-97: 🧹 Nitpick | 🔵 Trivial | 💤 Low valueConsider using array format for scopes to match JSON fixtures.
Line 58 defines
scopesas a string"openid", while all JSON asset files consistently use array format. Although this is a placeholder value for the missing-field test, using array format would improve consistency with the fixtures and make the expected input format more explicit.Lines 67-68 provide helpful context about the device flow not requiring
redirectUri.Suggested change for consistency
val validOidc = buildJsonObject { put("clientId", "a6859a12-5e6e-4f64-96bb-cc8577706bee") put("discoveryEndpoint", "https://auth.pingone.ca/300c4f2a-39d4-4ba9-a18a-f6de246006f4/as/.well-known/openid-configuration") - put("scopes", "openid") + put("scopes", buildJsonArray { add("openid") }) }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@davinci/src/androidTest/kotlin/com/pingidentity/davinci/OidcDeviceClientJsonConfigTest.kt` around lines 53 - 97, In the oidcDeviceClientMissingRequiredFieldReturnsError function, the scopes field in the validOidc JsonObject is defined as a string "openid" but should be an array format to maintain consistency with JSON asset fixtures throughout the codebase. Change the scopes value to use array format instead of string format when building the validOidc JsonObject.davinci/src/androidTest/kotlin/com/pingidentity/davinci/JsonConfigTest.kt (1)
128-179: 🧹 Nitpick | 🔵 Trivial | 💤 Low valueConsider using array format for scopes to match JSON fixtures.
Line 134 defines
scopesas a string"openid", while all JSON asset files consistently use array format (e.g.,["openid", "profile", "email"]). Although this test validates missing-field errors (so the scopes value is just a placeholder), using array format would improve consistency with the fixtures and make the expected input format more explicit.Suggested change for consistency
val base = buildJsonObject { put("oidc", buildJsonObject { put("clientId", "a6859a12-5e6e-4f64-96bb-cc8577706bee") put("discoveryEndpoint", "https://auth.pingone.ca/300c4f2a-39d4-4ba9-a18a-f6de246006f4/as/.well-known/openid-configuration") - put("scopes", "openid") + put("scopes", buildJsonArray { add("openid") }) put("redirectUri", "org.forgerock.demo://oauth2redirect") }) }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@davinci/src/androidTest/kotlin/com/pingidentity/davinci/JsonConfigTest.kt` around lines 128 - 179, In the daVinciMissingRequiredFieldReturnsError test function, the scopes field in the base JsonObject is currently defined as a string "openid", but all JSON fixture files consistently use array format. Modify the put statement for scopes in the base buildJsonObject to create a JsonArray containing "openid" instead of a plain string value, to maintain consistency with the fixture format used elsewhere in the codebase.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@davinci/src/androidTest/kotlin/com/pingidentity/davinci/JsonConfigTest.kt`:
- Around line 128-179: In the daVinciMissingRequiredFieldReturnsError test
function, the scopes field in the base JsonObject is currently defined as a
string "openid", but all JSON fixture files consistently use array format.
Modify the put statement for scopes in the base buildJsonObject to create a
JsonArray containing "openid" instead of a plain string value, to maintain
consistency with the fixture format used elsewhere in the codebase.
In
`@davinci/src/androidTest/kotlin/com/pingidentity/davinci/OidcDeviceClientJsonConfigTest.kt`:
- Around line 53-97: In the oidcDeviceClientMissingRequiredFieldReturnsError
function, the scopes field in the validOidc JsonObject is defined as a string
"openid" but should be an array format to maintain consistency with JSON asset
fixtures throughout the codebase. Change the scopes value to use array format
instead of string format when building the validOidc JsonObject.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f1f28926-66a6-42a2-a399-99fb916c75d9
📒 Files selected for processing (13)
davinci/src/androidTest/assets/full-davinci-config.jsondavinci/src/androidTest/assets/full-oidc-deviceclient.jsondavinci/src/androidTest/assets/minimal-davinci.jsondavinci/src/androidTest/assets/minimal-oidc-deviceclient.jsondavinci/src/androidTest/kotlin/com/pingidentity/davinci/JsonConfigTest.ktdavinci/src/androidTest/kotlin/com/pingidentity/davinci/OidcDeviceClientJsonConfigTest.ktjourney/build.gradle.ktsjourney/src/androidTest/assets/full-journey-config.jsonjourney/src/androidTest/assets/full-oidc-webclient.jsonjourney/src/androidTest/assets/minimal-journey.jsonjourney/src/androidTest/assets/minimal-oidc-webclient.jsonjourney/src/androidTest/kotlin/com/pingidentity/journey/JsonConfigTest.ktjourney/src/androidTest/kotlin/com/pingidentity/journey/OidcWebClientJsonConfigTest.kt
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #213 +/- ##
=============================================
+ Coverage 44.12% 44.39% +0.26%
Complexity 1393 1393
=============================================
Files 316 316
Lines 9760 9760
Branches 1495 1495
=============================================
+ Hits 4307 4333 +26
+ Misses 4891 4863 -28
- Partials 562 564 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
JIRA Ticket
SDKS-5068 [QA] Standardize SDK Configuration
Description
Added instrumented test coverage for the JSON configuration factory functions
DaVinci(json),Journey(json),OidcWebClient(json),OidcDeviceClient(json).All tests live in the existing
davinciandjourneyandroidTest modules.New test files
Summary by CodeRabbit
Release Notes