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

Remove super.cleanUp #13582

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -155,7 +155,6 @@ public void testInvokeAPIAfterChangeAPILifecycleToBlock() throws Exception {
public void cleanUpArtifacts() throws Exception {
restAPIStore.deleteApplication(applicationId);
restAPIPublisher.deleteAPI(apiId);
super.cleanUp();
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,5 @@ public void cleanUpArtifacts() throws Exception {
undeployAndDeleteAPIRevisionsUsingRest(newApiId, restAPIPublisher);
restAPIPublisher.deleteAPI(apiId);
restAPIPublisher.deleteAPI(newApiId);

super.cleanUp();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,6 @@ public void cleanUpArtifacts() throws Exception {
undeployAndDeleteAPIRevisionsUsingRest(newApiId, restAPIPublisher);
restAPIPublisher.deleteAPI(apiId);
restAPIPublisher.deleteAPI(newApiId);

super.cleanUp();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ public void testInvokeAPIAfterChangeAPILifecycleToRetired() throws Exception {
public void cleanUpArtifacts() throws Exception {
restAPIStore.deleteApplication(applicationId);
restAPIPublisher.deleteAPI(apiId);
super.cleanUp();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,6 @@ public void cleanUpArtifacts() throws Exception {
undeployAndDeleteAPIRevisionsUsingRest(apiId, restAPIPublisher);
restAPIPublisher.deleteAPI(apiId);
}
super.cleanUp();
}

private void validateIntrospectionResponse(User user, String accessToken, String clientId) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,6 @@ public void testInvokeApiWithAudienceValidationPass() throws Exception {
public void cleanUpArtifacts() throws Exception {
undeployAndDeleteAPIRevisionsUsingRest(apiId, restAPIPublisher);
undeployAndDeleteAPIProductRevisionsUsingRest(apiProductDTO.getId(), restAPIPublisher);
super.cleanUp();
userManagementClient.deleteUser(STANDARD_SUBSCRIBER);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ public void testUpdateTagsAndFilterByTags() 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 @@ -212,7 +212,6 @@ public void cleanUpArtifacts() throws Exception {
apiStoreClientUser1.removeAPISubscriptionByApplicationName (API_NAME, API_VERSION_1_0_0, providerName, applicationNameSilver);
apiStoreClientUser1.removeApplication(applicationNameSilver);
deleteAPI(apiIdentifier, apiPublisherClientUser1);
super.cleanUp();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ public void cleanUpArtifacts() 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 @@ -227,6 +227,5 @@ public void cleanUpArtifacts() throws Exception {
restAPIStore.removeApplicationById(applicationID);
undeployAndDeleteAPIRevisionsUsingRest(apiID, restAPIPublisher);
restAPIPublisher.deleteAPI(apiID);
super.cleanUp();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,6 @@ public void cleanUpArtifacts() throws Exception {
restAPIStore.removeApplicationById(applicationID);
undeployAndDeleteAPIRevisionsUsingRest(apiID, restAPIPublisher);
restAPIPublisher.deleteAPI(apiID);
super.cleanUp();
}

private void validateIntrospectionResponse(User user, String accessToken, String clientId) throws UnsupportedEncodingException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,5 @@ public void testCustomLifeCycle() throws Exception {
public void cleanupArtifacts() throws Exception {
//Remove test api and revert to original lifecycle config
restAPIPublisher.deleteAPI(apiId);
super.cleanUp();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ public void cleanUpArtifacts() 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 @@ -134,8 +134,6 @@ public void testUpdatedAPIInformationFromAPIPublisher() throws APIManagerIntegra
public void cleanUpArtifacts() throws Exception {
undeployAndDeleteAPIRevisionsUsingRest(apiId, restAPIPublisher);
restAPIPublisher.deleteAPI(apiId);
super.cleanUp();

}

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


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,5 @@ public void testLCStateChangeVisibility() 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 @@ -98,7 +98,6 @@ public void testBadRequestWithEndpointConfigAsNull() throws APIManagerIntegratio
@AfterClass(alwaysRun = true)
public void cleanUpArtifacts() throws Exception {
restAPIPublisher.deleteAPI(apiId);
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 @@ -815,7 +815,6 @@ public void cleanUpArtifacts() throws Exception {

restAPIPublisher.deleteAPI(apiID1);
restAPIPublisher.deleteAPI(apiID2);
super.cleanUp();
userManagementClient.deleteUser(RESTRICTED_SUBSCRIBER);
userManagementClient.deleteUser(STANDARD_SUBSCRIBER);
userManagementClient.deleteRole(RESTRICTED_ROLE);
Expand Down
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 @@ -630,6 +630,5 @@ public void testVerifyDevPortalAdminDeleteCommentTest() 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 @@ -880,6 +880,5 @@ public void destroyAPIs() throws Exception {
tenant2UserStoreManager.deleteRole("role1");
tenantManagementServiceClient.deleteTenant(tenant1Name);
tenantManagementServiceClient.deleteTenant(tenant2Name);
super.cleanUp();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1074,6 +1074,5 @@ public void destroy() throws Exception {
restAPIStore.deleteApplication(depthAppId);
restAPIStore.deleteApplication(throttleAppId);
undeployAndDeleteAPIRevisionsUsingRest(graphqlApiId, restAPIPublisher);
super.cleanUp();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,5 @@ public void cleanUpArtifacts() throws Exception {
restAPIStore.deleteApplication(testAppId4);
undeployAndDeleteAPIRevisionsUsingRest(graphqlAPIId, restAPIPublisher);
restAPIPublisher.deleteAPI(graphqlAPIId);
super.cleanUp();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,5 @@ public void destroy() throws Exception {
restAPIStore.deleteApplication(tokenTestApiAppId);
undeployAndDeleteAPIRevisionsUsingRest(graphqlApiId, restAPIPublisher);
restAPIPublisher.deleteAPI(graphqlApiId);
super.cleanUp();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ public void destroy() throws Exception {
restAPIStore.deleteApplication(applicationId);
undeployAndDeleteAPIRevisionsUsingRest(apiId, restAPIPublisher);
restAPIPublisher.deleteAPI(apiId);
super.cleanUp();
}

@DataProvider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,6 @@ public void destroy() throws Exception {
restAPIStore.deleteApplication(applicationId);
undeployAndDeleteAPIRevisionsUsingRest(apiId, restAPIPublisher);
restAPIPublisher.deleteAPI(apiId);

super.cleanUp();
}

@DataProvider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,6 @@ public void destroy() throws Exception {
restAPIStore.deleteApplication(jwtApplicationId);
restAPIPublisher.deleteAPI(apiId);
identityProviderMgtClient.deleteIdp("federated-idp");
super.cleanUp();

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,5 @@ public void destroy() throws Exception {
restAPIStore.deleteApplication(jwtApplicationId);
identityProviderMgtServiceClient.deleteIdP(jwtIssuer);
restAPIPublisher.removeSharedScope(scopeId);
super.cleanUp();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,6 @@ public void destroy() throws Exception {
undeployAndDeleteAPIRevisionsUsingRest(api2Id, restAPIPublisher);
restAPIPublisher.deleteAPI(apiId);
restAPIPublisher.deleteAPI(api2Id);
super.cleanUp();

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,6 @@ public void destroy() throws Exception {
restAPIPublisher.deleteAPI(apiId);
undeployAndDeleteAPIRevisionsUsingRest(apiIdOnlyKm1, restAPIPublisher);
restAPIPublisher.deleteAPI(apiIdOnlyKm1);
super.cleanUp();
}

@DataProvider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,6 @@ public void testJWTDecodingforCustomApplication() throws Exception {
restAPIStore.deleteApplication(decodingApplicationId);
undeployAndDeleteAPIRevisionsUsingRest(decodingApiId, restAPIPublisher);
restAPIPublisher.deleteAPI(decodingApiId);
super.cleanUp();

}

private void createUser()
Expand Down
Loading
Loading