Skip to content

Commit

Permalink
Remove super.cleanUp
Browse files Browse the repository at this point in the history
  • Loading branch information
AnuGayan committed Oct 20, 2024
1 parent b39e5c1 commit 4f48194
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,5 @@ public void destroy() throws Exception {
restAPIStore.deleteApplication(applicationId);
restAPIPublisher.deleteAPI(apiID);
userManagementClient.deleteUser(newUser);
super.cleanUp();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ public void cleanUpArtifacts() throws Exception {
restAPIPublisher.deleteAPI(apiId);
restAPIPublisher.deleteAPI(newApiId);

super.cleanUp();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,5 @@ public void destroy() throws Exception {
restAPIStore.deleteApplication(applicationID);
undeployAndDeleteAPIRevisionsUsingRest(apiId, restAPIPublisher);
restAPIPublisher.deleteAPI(apiId);
super.cleanUp();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ public void testAPIPublishing() throws Exception {
public void cleanUpArtifacts() throws Exception {
undeployAndDeleteAPIRevisionsUsingRest(apiId, restAPIPublisher);
restAPIPublisher.deleteAPI(apiId);
super.cleanUp();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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<APIDTO> apisToBeUsed = new ArrayList<>();

@BeforeClass(alwaysRun = true)
public void setEnvironment() throws Exception {
Expand All @@ -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<APIDTO> apisToBeUsed = new ArrayList<>();

apisToBeUsed.add(apiTestHelper.
createApiOne(getBackendEndServiceEndPointHttp("wildcard/resources")));
Expand Down Expand Up @@ -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<JSONObject> revisionList = new ArrayList<>();
Expand All @@ -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");
Expand All @@ -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());
}
Expand Down Expand Up @@ -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());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ public void testApplicationUpdateValidIpAsCallBackURL() throws Exception {
@AfterClass(alwaysRun = true)
public void destroy() throws Exception {
apiStore.removeApplication(appName);
super.cleanUp();
}

@DataProvider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ public void testRegenerateConsumerSecret() throws Exception {
@AfterClass(alwaysRun = true)
public void destroy() throws Exception {
restAPIStore.deleteApplication(applicationID);
super.cleanUp();
}

@DataProvider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,5 @@ public void testVerifyPublisherAdminDeleteCommentTest() throws Exception {
@AfterClass(alwaysRun = true)
public void destroy() throws Exception {
restAPIPublisher.deleteAPI(apiId);
super.cleanUp();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,5 @@ private String apiContextResolver(String context, String version) {
public void destroy() throws Exception {
restAPIAdmin.deleteDenyThrottlingPolicy(blockingCondition1ID);
restAPIAdmin.deleteDenyThrottlingPolicy(blockingCondition2ID);
super.cleanUp();
}
}

0 comments on commit 4f48194

Please sign in to comment.