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 unused synapse APIs #13584

Merged
merged 3 commits into from
Oct 22, 2024
Merged
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 @@ -493,5 +493,3 @@ logger.org-wso2-carbon-apimgt-gateway-mediators-BotDetectionMediator.name = org.
logger.org-wso2-carbon-apimgt-gateway-mediators-BotDetectionMediator.level = INFO
logger.org-wso2-carbon-apimgt-gateway-mediators-BotDetectionMediator.appenderRef.BOTDATA_APPENDER.ref = BOTDATA_APPENDER
logger.org-wso2-carbon-apimgt-gateway-mediators-BotDetectionMediator.additivity = false

category.SERVICE_APPENDER._OpenService_ = TRACE_APPENDER, BOTDATA_APPENDER

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.wso2.carbon.integration.common.utils.FileManager;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import javax.xml.xpath.XPathExpressionException;

Expand Down Expand Up @@ -116,6 +117,12 @@ public void configureServer() throws AutomationFrameworkException {
+ "deployment" + File.separator + "server" + File.separator + "synapse-configs"
+ File.separator + "default" + File.separator + "api";

try {
FileManager.readFile(synapseApiPath);
} catch (FileNotFoundException e) {
new File(synapseApiPath).mkdirs();
}

FileManager.copyFile(new File(
resourcePath + File.separator + "synapseconfigs" + File.separator + "rest" + File.separator
+ "BackEndSecurity.xml"), synapseApiPath + File.separator + "BackEndSecurity.xml");
Expand Down
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();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -493,5 +493,3 @@ logger.org-wso2-carbon-apimgt-gateway-mediators-BotDetectionMediator.name = org.
logger.org-wso2-carbon-apimgt-gateway-mediators-BotDetectionMediator.level = INFO
logger.org-wso2-carbon-apimgt-gateway-mediators-BotDetectionMediator.appenderRef.BOTDATA_APPENDER.ref = BOTDATA_APPENDER
logger.org-wso2-carbon-apimgt-gateway-mediators-BotDetectionMediator.additivity = false

category.SERVICE_APPENDER._OpenService_ = TRACE_APPENDER, BOTDATA_APPENDER
Original file line number Diff line number Diff line change
Expand Up @@ -497,5 +497,3 @@ logger.org-wso2-carbon-apimgt-gateway-mediators-BotDetectionMediator.name = org.
logger.org-wso2-carbon-apimgt-gateway-mediators-BotDetectionMediator.level = INFO
logger.org-wso2-carbon-apimgt-gateway-mediators-BotDetectionMediator.appenderRef.BOTDATA_APPENDER.ref = BOTDATA_APPENDER
logger.org-wso2-carbon-apimgt-gateway-mediators-BotDetectionMediator.additivity = false

category.SERVICE_APPENDER._OpenService_ = TRACE_APPENDER, BOTDATA_APPENDER
Original file line number Diff line number Diff line change
Expand Up @@ -452,5 +452,3 @@ logger.org-wso2-carbon-apimgt-gateway-mediators-BotDetectionMediator.name = org.
logger.org-wso2-carbon-apimgt-gateway-mediators-BotDetectionMediator.level = INFO
logger.org-wso2-carbon-apimgt-gateway-mediators-BotDetectionMediator.appenderRef.BOTDATA_APPENDER.ref = BOTDATA_APPENDER
logger.org-wso2-carbon-apimgt-gateway-mediators-BotDetectionMediator.additivity = false

category.SERVICE_APPENDER._OpenService_ = TRACE_APPENDER, BOTDATA_APPENDER
Original file line number Diff line number Diff line change
Expand Up @@ -476,5 +476,3 @@ logger.org-wso2-carbon-apimgt-gateway-mediators-BotDetectionMediator.name = org.
logger.org-wso2-carbon-apimgt-gateway-mediators-BotDetectionMediator.level = INFO
logger.org-wso2-carbon-apimgt-gateway-mediators-BotDetectionMediator.appenderRef.BOTDATA_APPENDER.ref = BOTDATA_APPENDER
logger.org-wso2-carbon-apimgt-gateway-mediators-BotDetectionMediator.additivity = false

category.SERVICE_APPENDER._OpenService_ = TRACE_APPENDER, BOTDATA_APPENDER
Original file line number Diff line number Diff line change
Expand Up @@ -476,5 +476,3 @@ logger.org-wso2-carbon-apimgt-gateway-mediators-BotDetectionMediator.name = org.
logger.org-wso2-carbon-apimgt-gateway-mediators-BotDetectionMediator.level = INFO
logger.org-wso2-carbon-apimgt-gateway-mediators-BotDetectionMediator.appenderRef.BOTDATA_APPENDER.ref = BOTDATA_APPENDER
logger.org-wso2-carbon-apimgt-gateway-mediators-BotDetectionMediator.additivity = false

category.SERVICE_APPENDER._OpenService_ = TRACE_APPENDER, BOTDATA_APPENDER
Loading