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

[Security] Bump synapse-core from 2.1.7-wso2v168 to 3.0.1 #57

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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 @@ -435,6 +435,10 @@ public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public org.json.simple.JSONObject getEndpointConfig() {
return endpoint;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
public class APIM520UpdateAnAPIThroughThePublisherRestAPITestCase extends APIMIntegrationBaseTest {

private final String apiNameTest = "APIM520PublisherTest";
private final String apiUpdatedNameTest = "PublisherTestRenameAPI";
private final String updatedApiName = "PublisherNewTestRenameAPI";
private final String apiVersion = "1.0.0";
private APIPublisherRestClient apiPublisher;
private String apiProviderName;
Expand Down Expand Up @@ -138,6 +140,46 @@ public void testUpdateAnAPIThroughThePublisherRest() throws Exception {

}

@Test(groups = {"wso2.am"}, description = "Update an API Through the Publisher Rest API after renaming the API")
public void testUpdateAnAPIThroughThePublisherRestAfterRename() throws Exception {

String apiContextTest = "apiRenamingContext";
String apiDescription = "This is Test API Created by API Manager Integration Test for API Renaming";

//Create an API
APIRequest apiCreationRequestBean = new APIRequest(apiUpdatedNameTest, apiContextTest,
new URL(apiProductionEndPointUrl));
apiCreationRequestBean.setVersion(apiVersion);
apiCreationRequestBean.setProvider(apiProviderName);
apiCreationRequestBean.setDescription(apiDescription);
apiCreationRequestBean.setTiersCollection("Gold,Bronze");

HttpResponse apiCreationResponse = restAPIPublisher.addAPI(apiCreationRequestBean);
id = apiCreationResponse.getData();
assertEquals(apiCreationResponse.getResponseCode(), Response.Status.CREATED.getStatusCode(),
"Response Code miss matched when creating the API");

//Check availability of the API in publisher
HttpResponse apiResponsePublisher = restAPIPublisher.getAPI(id);
assertTrue(apiResponsePublisher.getData().contains(apiUpdatedNameTest),
apiUpdatedNameTest + " is not visible in publisher");

//Update API with name change
apiCreationRequestBean.setName(updatedApiName);

HttpResponse apiUpdateResponse = restAPIPublisher.updateAPI(apiCreationRequestBean, id);
assertEquals(apiUpdateResponse.getResponseCode(), Response.Status.OK.getStatusCode(),
"Response Code miss matched when creating the API");
waitForAPIDeployment();

// Check whether API is updated from the above request. This API Name should not get updated
// when not in a cloud scenario
HttpResponse apiUpdateResponsePublisher = restAPIPublisher.getAPI(id);

assertTrue(apiUpdateResponsePublisher.getData().contains(apiUpdatedNameTest),
apiUpdatedNameTest + " is updated");
}

@AfterClass(alwaysRun = true)
public void destroyAPIs() throws Exception {
restAPIPublisher.deleteAPI(id);
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,7 @@
<opencsv.version>1.8</opencsv.version>
<poi.version>3.0-FINAL</poi.version>
<woden.version>1.0.0.M8-wso2v1</woden.version>
<synapse.version>2.1.7-wso2v227</synapse.version>
<synapse.version>3.0.1</synapse.version>
<passthru.transport.patch.version>1.0.2</passthru.transport.patch.version>
<axis2.wso2.version>1.6.1-wso2v63</axis2.wso2.version>
<axiom.wso2.version>1.2.11-wso2v16</axiom.wso2.version>
Expand Down