Add pre-issue access token tests for sessionDataKeyConsent#27309
Add pre-issue access token tests for sessionDataKeyConsent#27309anjuchamantha wants to merge 2 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
| @Test(groups = "wso2.is", dependsOnMethods = "testGetAccessTokenWithAuthCodeGrant", | ||
| description = "Verify that the pre issue access token action request contains the session " + | ||
| "with a valid sessionDataKeyConsent for authorization code grant") | ||
| public void testPreIssueAccessTokenActionRequestContainsSession() throws Exception { | ||
|
|
||
| String actualRequestPayload = | ||
| serviceExtensionMockServer.getReceivedRequestPayload(MOCK_SERVER_ENDPOINT_RESOURCE_PATH); | ||
| PreIssueAccessTokenActionRequest actualRequest = | ||
| new ObjectMapper().readValue(actualRequestPayload, PreIssueAccessTokenActionRequest.class); | ||
|
|
||
| Session session = actualRequest.getEvent().getSession(); | ||
| assertNotNull(session, "Session object should be present in the action request for authorization code grant."); | ||
| assertNotNull(session.getSessionDataKeyConsent(), | ||
| "sessionDataKeyConsent should be present in the session for authorization code grant."); | ||
| assertFalse(session.getSessionDataKeyConsent().isEmpty(), | ||
| "sessionDataKeyConsent should not be empty."); | ||
| } |
There was a problem hiding this comment.
No need to introduce a new Test case, let's verify the session object related changes in the testPreIssueAccessTokenActionRequest() test method
… testPreIssueAccessTokenActionRequest
|
|
PR builder started |
|
PR builder started |
|
PR builder completed |
jenkins-is-staging
left a comment
There was a problem hiding this comment.
Approving the pull request based on the successful pr build https://github.com/wso2/product-is/actions/runs/23636714763
|
PR builder completed |
|
PR builder started |
|
PR builder completed |
jenkins-is-staging
left a comment
There was a problem hiding this comment.
Approving the pull request based on the successful pr build https://github.com/wso2/product-is/actions/runs/23636760115
| assertNotNull(session.getSessionDataKeyConsent(), | ||
| "sessionDataKeyConsent should be present in the session for authorization code grant."); | ||
| assertFalse(session.getSessionDataKeyConsent().isEmpty(), | ||
| "sessionDataKeyConsent should not be empty."); |
There was a problem hiding this comment.
Shall we validate the whether the sessionDataKeyConscent value in the action request is equal to the sessionDataKeyConsent variable value as well ?
There was a problem hiding this comment.
Apologies I have missed this. These type of validations (verifying value in the action request is the actual value) should be covered in other general pre issue action tests.



Related Issue:
Related PR: