Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[integration tests] Pre issues access token action with password grant type #20903

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

Shenali-SJ
Copy link
Contributor

@Shenali-SJ Shenali-SJ commented Aug 13, 2024

Description

This adds integration tests for the pre issue access token action execution flow with the password grant type.
This covers the test cases for the following scenarios.

  • Add, replace, remove custom scopes
  • Add, replace, remove aud claim
  • Add custom claims - (data types supported: string, number, boolean, string array)
  • Replace expires_in claim

A mock server has been set up using Wiremock to simulate the external service. The mock server runs locally on the port 8587.

Related Issue

@Shenali-SJ Shenali-SJ force-pushed the actions-integration-tests branch 5 times, most recently from 346ccbe to 874cc0d Compare August 21, 2024 09:56
@Shenali-SJ Shenali-SJ marked this pull request as ready for review August 21, 2024 22:23
@Shenali-SJ Shenali-SJ changed the title [integration tests] Pre Issues Access Token [integration tests] Pre Issues Access Token with Password Grant Type Aug 22, 2024
@Shenali-SJ Shenali-SJ changed the title [integration tests] Pre Issues Access Token with Password Grant Type [integration tests] Pre issues access token action with password grant type Aug 22, 2024
MockServer.createMockServer(MOCK_SERVER_ENDPOINT);
createPreIssueAccessTokenAction();

accessToken = retrieveAccessToken(application.getId(), customScopes);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Retrieving access token should be a test case. We should assert for the request that goes to the mock server.
We can do this as an improvement to the test case

Comment on lines 215 to 223
@Test(groups = "wso2.is", description = "Verify the presence of the specified custom boolean claim in the access " +
"token", dataProvider = "getBooleanClaim")
public void testTokenBooleanClaimAddOperation(String claim, Boolean newClaimValue, int index) throws Exception {

Boolean claimValue = jwtClaims.getBooleanClaim(claim);
if (index == 0) {
Assert.assertEquals(claimValue, newClaimValue);
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refer the comment above. Have same concerns

@jenkins-is-staging
Copy link
Contributor

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/10571484246

@jenkins-is-staging
Copy link
Contributor

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/10571484246
Status: failure

@Shenali-SJ Shenali-SJ force-pushed the actions-integration-tests branch 3 times, most recently from 128d010 to 4412a64 Compare August 28, 2024 06:23
@jenkins-is-staging
Copy link
Contributor

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/10591399467

@jenkins-is-staging
Copy link
Contributor

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/10591399467
Status: failure

Add test cases

Improve formatting

Improve formatting

Clean the code

Restructre the architecture

Reformat the code

Revert unneccessary formatting

Add new application logic

Addressed the comments

Integrate mock service

Increase code readability

Reformat the code

Restructure the base architecture

Add new test case to testng file

Fix formatting issues

Update the implementation

Reset formatting

Fix formatting issues

Fix formatting issues

Remove data providers

Update snakeyaml dependency

Reformat code

Update the test atEnd method

Change the order of execution of atEnd method

Change the order of execution of atEnd method
@jenkins-is-staging
Copy link
Contributor

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/10596719407

@jenkins-is-staging
Copy link
Contributor

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/10596719407
Status: success

Copy link
Contributor

@jenkins-is-staging jenkins-is-staging left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving the pull request based on the successful pr build https://github.com/wso2/product-is/actions/runs/10596719407

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants