Add granular console scopes integration tests#28189
Conversation
Ported from wso2-support/product-is#2175. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
📝 WalkthroughSummary
WalkthroughAdds Sequence Diagram(s)sequenceDiagram
participant TestCase
participant ConfigManager
participant IdentityServer
participant SCIM2Client
TestCase->>ConfigManager: Enable granular permission setting
ConfigManager->>IdentityServer: Apply configuration
TestCase->>IdentityServer: Graceful restart
TestCase->>SCIM2Client: Create and retrieve Console role
SCIM2Client->>IdentityServer: Request v2 role
IdentityServer-->>SCIM2Client: Resolved permissions
SCIM2Client-->>TestCase: Permission values
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 (1)
modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/rest/api/server/roles/v2/ConsoleGranularScopeTestCase.java (1)
117-118: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse
Files.createTempFileand ensure deletion.For better safety and to ensure cleanup, use
Files.createTempFileand register it for deletion on exit. As per path instructions, this focuses on correctness and best practices.♻️ Proposed fix
- File enabledTomlFile = File.createTempFile("console-granular-enabled", ".toml"); - Files.write(enabledTomlFile.toPath(), content.getBytes(StandardCharsets.UTF_8)); + File enabledTomlFile = Files.createTempFile("console-granular-enabled", ".toml").toFile(); + enabledTomlFile.deleteOnExit(); + Files.write(enabledTomlFile.toPath(), content.getBytes(StandardCharsets.UTF_8));🤖 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 `@modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/rest/api/server/roles/v2/ConsoleGranularScopeTestCase.java` around lines 117 - 118, Update the temporary-file setup in ConsoleGranularScopeTestCase to use Files.createTempFile instead of File.createTempFile, and register the created path for deletion on exit before writing content. Preserve the existing UTF-8 file contents and enabled TOML test flow.Sources: Path instructions, Linters/SAST tools
🤖 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
`@modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/rest/api/server/roles/v2/ConsoleGranularScopeTestCase.java`:
- Around line 117-118: Update the temporary-file setup in
ConsoleGranularScopeTestCase to use Files.createTempFile instead of
File.createTempFile, and register the created path for deletion on exit before
writing content. Preserve the existing UTF-8 file contents and enabled TOML test
flow.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: dffca029-62bf-4964-aabd-b99be0def367
📒 Files selected for processing (3)
modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/rest/api/server/roles/v2/ConsoleGranularScopeTestCase.javamodules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/restclients/SCIM2RestClient.javamodules/integration/tests-integration/tests-backend/src/test/resources/testng.xml



Ports the granular console scopes integration tests from wso2-support/product-is#2175 to master.
Changes
ConsoleGranularScopeTestCase— covers Console role permission resolution for granular application feature scopes (console:applications_create/_update/_delete) withuse_granular_console_permissionstoggled off and on.getV2Role(...)andgetV2RolePermissions(...)helpers.Notes
pom.xmldependency bumps from the source PR were not ported — those are 7.1.0-line patch builds. This branch is on a newer dependency line assumed to already contain the feature.🤖 Generated with Claude Code