From 4f4819429ae1546bffb501297c147ca99d2d9398 Mon Sep 17 00:00:00 2001 From: AnuGayan Date: Sun, 20 Oct 2024 08:03:09 +0530 Subject: [PATCH] Remove super.cleanUp --- .../tests/admin/ChangeApiProviderTestCase.java | 1 - ...ublishedOldAPIAndPublishedCopyAPITestCase.java | 1 - .../APIMANAGER5337SubscriptionRetainTestCase.java | 1 - ...APIPublishingAndVisibilityInStoreTestCase.java | 1 - .../lifecycle/APIVisibilityByRoleTestCase.java | 1 - .../api/revision/APIProductRevisionTestCase.java | 15 ++++++++------- .../ApplicationCallbackURLTestCase.java | 1 - ...plicationConsumerSecretRegenerateTestCase.java | 1 - .../groupSharing/ApplicationSharingTestCase.java | 11 +++++------ .../tests/comments/DevPortalCommentTest.java | 1 - .../DenyPolicySearchTestCase.java | 1 - 11 files changed, 13 insertions(+), 22 deletions(-) diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/admin/ChangeApiProviderTestCase.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/admin/ChangeApiProviderTestCase.java index e227b3dc22..7266ee9399 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/admin/ChangeApiProviderTestCase.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/admin/ChangeApiProviderTestCase.java @@ -169,6 +169,5 @@ public void destroy() throws Exception { restAPIStore.deleteApplication(applicationId); restAPIPublisher.deleteAPI(apiID); userManagementClient.deleteUser(newUser); - super.cleanUp(); } } diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/lifecycle/APIAccessibilityOfPublishedOldAPIAndPublishedCopyAPITestCase.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/lifecycle/APIAccessibilityOfPublishedOldAPIAndPublishedCopyAPITestCase.java index 45ce1e7a25..f75dc6eb30 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/lifecycle/APIAccessibilityOfPublishedOldAPIAndPublishedCopyAPITestCase.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/lifecycle/APIAccessibilityOfPublishedOldAPIAndPublishedCopyAPITestCase.java @@ -239,7 +239,6 @@ public void cleanUpArtifacts() throws Exception { restAPIPublisher.deleteAPI(apiId); restAPIPublisher.deleteAPI(newApiId); - super.cleanUp(); } } diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/lifecycle/APIMANAGER5337SubscriptionRetainTestCase.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/lifecycle/APIMANAGER5337SubscriptionRetainTestCase.java index fe35d326c0..c8823f1bd5 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/lifecycle/APIMANAGER5337SubscriptionRetainTestCase.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/lifecycle/APIMANAGER5337SubscriptionRetainTestCase.java @@ -118,6 +118,5 @@ public void destroy() throws Exception { restAPIStore.deleteApplication(applicationID); undeployAndDeleteAPIRevisionsUsingRest(apiId, restAPIPublisher); restAPIPublisher.deleteAPI(apiId); - super.cleanUp(); } } diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/lifecycle/APIPublishingAndVisibilityInStoreTestCase.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/lifecycle/APIPublishingAndVisibilityInStoreTestCase.java index 86f060ce69..9f0a08b42a 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/lifecycle/APIPublishingAndVisibilityInStoreTestCase.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/lifecycle/APIPublishingAndVisibilityInStoreTestCase.java @@ -131,7 +131,6 @@ public void testAPIPublishing() throws Exception { public void cleanUpArtifacts() throws Exception { undeployAndDeleteAPIRevisionsUsingRest(apiId, restAPIPublisher); restAPIPublisher.deleteAPI(apiId); - super.cleanUp(); } diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/lifecycle/APIVisibilityByRoleTestCase.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/lifecycle/APIVisibilityByRoleTestCase.java index 6fb5b27c44..18e08c4add 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/lifecycle/APIVisibilityByRoleTestCase.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/lifecycle/APIVisibilityByRoleTestCase.java @@ -486,7 +486,6 @@ public void cleanUpArtifacts() throws Exception { deleteAPI(apiVisibilityByRoleId, apiPublisherClientCarbonSuperAdmin); userManagementClient1.deleteUser(CARBON_SUPER_SUBSCRIBER_USERNAME); userManagementClient2.deleteUser(TENANT_SUBSCRIBER_USERNAME); - super.cleanUp(); } } \ No newline at end of file diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/revision/APIProductRevisionTestCase.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/revision/APIProductRevisionTestCase.java index d24e36c41f..5650cdddbc 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/revision/APIProductRevisionTestCase.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/revision/APIProductRevisionTestCase.java @@ -18,7 +18,6 @@ package org.wso2.am.integration.tests.api.revision; -import com.google.gson.Gson; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.json.JSONArray; @@ -28,7 +27,6 @@ import org.testng.annotations.Test; import org.wso2.am.integration.clients.publisher.api.v1.dto.APIDTO; import org.wso2.am.integration.clients.publisher.api.v1.dto.APIProductDTO; -import org.wso2.am.integration.clients.publisher.api.v1.dto.APIRevisionListDTO; import org.wso2.am.integration.test.Constants; import org.wso2.am.integration.test.impl.ApiProductTestHelper; import org.wso2.am.integration.test.impl.ApiTestHelper; @@ -55,6 +53,7 @@ public class APIProductRevisionTestCase extends APIMIntegrationBaseTest { private ApiProductTestHelper apiProductTestHelper; protected static final String TIER_UNLIMITED = "Unlimited"; protected static final String TIER_GOLD = "Gold"; + List apisToBeUsed = new ArrayList<>(); @BeforeClass(alwaysRun = true) public void setEnvironment() throws Exception { @@ -68,7 +67,6 @@ public void setEnvironment() throws Exception { @Test(groups = {"wso2.am"}, description = "API Product Revision create test case") public void testAddingAPIProductRevision() throws Exception { // Pre-Conditions : Create APIs - List apisToBeUsed = new ArrayList<>(); apisToBeUsed.add(apiTestHelper. createApiOne(getBackendEndServiceEndPointHttp("wildcard/resources"))); @@ -105,7 +103,7 @@ public void testAddingAPIProductRevision() throws Exception { @Test(groups = {"wso2.am"}, description = "Check the availability of API Product Revision in publisher before deploying.", dependsOnMethods = "testAddingAPIProductRevision") public void testGetAPIProductRevisions() throws Exception { - HttpResponse apiRevisionsGetResponse = restAPIPublisher.getAPIProductRevisions(apiId,null); + HttpResponse apiRevisionsGetResponse = restAPIPublisher.getAPIProductRevisions(apiId, null); assertEquals(apiRevisionsGetResponse.getResponseCode(), HTTP_RESPONSE_CODE_OK, "Unable to retrieve revisions" + apiRevisionsGetResponse.getData()); List revisionList = new ArrayList<>(); @@ -115,7 +113,7 @@ public void testGetAPIProductRevisions() throws Exception { for (int i = 0, l = arrayList.length(); i < l; i++) { revisionList.add(arrayList.getJSONObject(i)); } - for (JSONObject revision :revisionList) { + for (JSONObject revision : revisionList) { revisionUUID = revision.getString("id"); } assertNotNull(revisionUUID, "Unable to retrieve revision UUID"); @@ -131,7 +129,7 @@ public void testDeployAPIProductRevisions() throws Exception { apiRevisionDeployRequest.setDisplayOnDevportal(true); apiRevisionDeployRequestList.add(apiRevisionDeployRequest); HttpResponse apiRevisionsDeployResponse = restAPIPublisher.deployAPIProductRevision(apiId, revisionUUID, - apiRevisionDeployRequestList,"APIProduct"); + apiRevisionDeployRequestList, "APIProduct"); assertEquals(apiRevisionsDeployResponse.getResponseCode(), HTTP_RESPONSE_CODE_CREATED, "Unable to deploy API Product Revisions:" + apiRevisionsDeployResponse.getData()); } @@ -174,6 +172,9 @@ public void testDeleteAPIProductRevision() throws Exception { @AfterClass(alwaysRun = true) public void destroy() throws Exception { - super.cleanUp(); + restAPIPublisher.deleteAPI(apiId); + for (APIDTO api : apisToBeUsed) { + restAPIPublisher.deleteAPI(api.getId()); + } } } diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/application/ApplicationCallbackURLTestCase.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/application/ApplicationCallbackURLTestCase.java index a6fbb5d782..de743884e0 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/application/ApplicationCallbackURLTestCase.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/application/ApplicationCallbackURLTestCase.java @@ -163,7 +163,6 @@ public void testApplicationUpdateValidIpAsCallBackURL() throws Exception { @AfterClass(alwaysRun = true) public void destroy() throws Exception { apiStore.removeApplication(appName); - super.cleanUp(); } @DataProvider diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/application/ApplicationConsumerSecretRegenerateTestCase.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/application/ApplicationConsumerSecretRegenerateTestCase.java index 123c8c675e..2fab7751c3 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/application/ApplicationConsumerSecretRegenerateTestCase.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/application/ApplicationConsumerSecretRegenerateTestCase.java @@ -98,7 +98,6 @@ public void testRegenerateConsumerSecret() throws Exception { @AfterClass(alwaysRun = true) public void destroy() throws Exception { restAPIStore.deleteApplication(applicationID); - super.cleanUp(); } @DataProvider diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/application/groupSharing/ApplicationSharingTestCase.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/application/groupSharing/ApplicationSharingTestCase.java index cf3c85c829..b0f651a741 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/application/groupSharing/ApplicationSharingTestCase.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/application/groupSharing/ApplicationSharingTestCase.java @@ -144,12 +144,6 @@ public void testAPIKeyRevocationBySharedUser() restAPIStoreClientUser2.revokeAPIKey(userOneSharedApplicationId, key.getApikey()); } - @AfterClass(alwaysRun = true) - public void destroy() throws Exception { - restAPIStoreClientUser2.removeApplicationById(userTwoApplicationId); - super.cleanUp(); - } - private void createUsersAndApplications() throws Exception { //signup of user one UserManagementUtils.signupUser(USER_ONE, PASSWORD, FIRST_NAME, ORGANIZATION); @@ -176,4 +170,9 @@ private void createUsersAndApplications() throws Exception { ApplicationDTO.TokenTypeEnum.JWT, groups); userOneSharedApplicationId = appCreationResponse3.getData(); } + + @AfterClass(alwaysRun = true) + public void destroy() throws Exception { + restAPIStoreClientUser2.removeApplicationById(userTwoApplicationId); + } } diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/comments/DevPortalCommentTest.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/comments/DevPortalCommentTest.java index 7d5037a4e5..d79387e6e3 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/comments/DevPortalCommentTest.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/comments/DevPortalCommentTest.java @@ -659,6 +659,5 @@ public void testVerifyPublisherAdminDeleteCommentTest() throws Exception { @AfterClass(alwaysRun = true) public void destroy() throws Exception { restAPIPublisher.deleteAPI(apiId); - super.cleanUp(); } } diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/restapi/admin/throttlingpolicy/DenyPolicySearchTestCase.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/restapi/admin/throttlingpolicy/DenyPolicySearchTestCase.java index ecfc066b3e..1471749ad2 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/restapi/admin/throttlingpolicy/DenyPolicySearchTestCase.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/restapi/admin/throttlingpolicy/DenyPolicySearchTestCase.java @@ -166,6 +166,5 @@ private String apiContextResolver(String context, String version) { public void destroy() throws Exception { restAPIAdmin.deleteDenyThrottlingPolicy(blockingCondition1ID); restAPIAdmin.deleteDenyThrottlingPolicy(blockingCondition2ID); - super.cleanUp(); } } \ No newline at end of file