From b82f2a1eccec0ebb4aca7dcef2473796b396340f Mon Sep 17 00:00:00 2001 From: Shenali Date: Tue, 17 Sep 2024 00:19:17 +0530 Subject: [PATCH] Update formatting --- ...IssueAccessTokenClientCredentialsGrantTestCase.java | 6 +++++- .../actions/PreIssueAccessTokenCodeGrantTestCase.java | 10 +++++++--- .../test/actions/mockserver/ActionsMockServer.java | 3 --- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/actions/PreIssueAccessTokenClientCredentialsGrantTestCase.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/actions/PreIssueAccessTokenClientCredentialsGrantTestCase.java index e3c50f78d3..857d4a722e 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/actions/PreIssueAccessTokenClientCredentialsGrantTestCase.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/actions/PreIssueAccessTokenClientCredentialsGrantTestCase.java @@ -197,16 +197,20 @@ protected boolean isRedirectable(String method) { @AfterClass(alwaysRun = true) public void atEnd() throws Exception { + actionsMockServer.startServer(); + deleteAction(PRE_ISSUE_ACCESS_TOKEN_API_PATH, actionId); deleteRole(roleId); deleteApp(applicationId); deleteDomainAPI(domainAPIId); scim2RestClient.deleteUser(userId); - actionsMockServer.shutDownMockServer(); + restClient.closeHttpClient(); scim2RestClient.closeHttpClient(); actionsRestClient.closeHttpClient(); client.close(); + + actionsMockServer = null; accessToken = null; jwtClaims = null; } diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/actions/PreIssueAccessTokenCodeGrantTestCase.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/actions/PreIssueAccessTokenCodeGrantTestCase.java index 3e72aca526..b8d39863fe 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/actions/PreIssueAccessTokenCodeGrantTestCase.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/actions/PreIssueAccessTokenCodeGrantTestCase.java @@ -195,16 +195,20 @@ protected boolean isRedirectable(String method) { @AfterClass(alwaysRun = true) public void atEnd() throws Exception { + actionsMockServer.startServer(); + deleteAction(PRE_ISSUE_ACCESS_TOKEN_API_PATH, actionId); deleteRole(roleId); deleteApp(applicationId); deleteDomainAPI(domainAPIId); scim2RestClient.deleteUser(userId); - actionsMockServer.shutDownMockServer(); + restClient.closeHttpClient(); scim2RestClient.closeHttpClient(); actionsRestClient.closeHttpClient(); client.close(); + + actionsMockServer = null; authorizationCode = null; accessToken = null; jwtClaims = null; @@ -298,8 +302,8 @@ public void testTokenScopeOperations() throws Exception { Assert.assertTrue(ArrayUtils.contains(scopes, NEW_SCOPE_2)); Assert.assertTrue(ArrayUtils.contains(scopes, NEW_SCOPE_3)); Assert.assertTrue(ArrayUtils.contains(scopes, NEW_SCOPE_4)); - Assert.assertFalse(ArrayUtils.contains(scopes, CUSTOM_SCOPE_3)); // replace - 7 - Assert.assertFalse(ArrayUtils.contains(scopes, INTERNAL_ORG_USER_MANAGEMENT_CREATE)); // remove - 8 + Assert.assertFalse(ArrayUtils.contains(scopes, CUSTOM_SCOPE_3)); + Assert.assertFalse(ArrayUtils.contains(scopes, INTERNAL_ORG_USER_MANAGEMENT_CREATE)); } @Test(groups = "wso2.is", description = "Verify that the access token contains the updated OIDC claims " + diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/actions/mockserver/ActionsMockServer.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/actions/mockserver/ActionsMockServer.java index 0f9f4279ed..d77a4998bc 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/actions/mockserver/ActionsMockServer.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/actions/mockserver/ActionsMockServer.java @@ -19,16 +19,13 @@ package org.wso2.identity.integration.test.actions.mockserver; import com.github.tomakehurst.wiremock.WireMockServer; -import com.github.tomakehurst.wiremock.client.WireMock; import com.github.tomakehurst.wiremock.core.WireMockConfiguration; -import com.github.tomakehurst.wiremock.matching.RequestPatternBuilder; import com.github.tomakehurst.wiremock.verification.LoggedRequest; import org.apache.commons.lang.StringUtils; import java.util.List; import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.equalToJson; import static com.github.tomakehurst.wiremock.client.WireMock.matching; import static com.github.tomakehurst.wiremock.client.WireMock.post; import static com.github.tomakehurst.wiremock.client.WireMock.postRequestedFor;