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 org.springframework.version from 5.1.13.RELEASE to 5.3.9 #84

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 @@ -1385,7 +1385,7 @@
<testng.version>6.11</testng.version>
<org.apache.cxf.version>3.2.8</org.apache.cxf.version>
<org.apache.axis2.transport.version>2.0.0-wso2v2</org.apache.axis2.transport.version>
<org.springframework.version>5.1.13.RELEASE</org.springframework.version>
<org.springframework.version>5.3.9</org.springframework.version>
<org.apache.tomcat>7.0.96</org.apache.tomcat>
<org.codehaus.jackson.version>1.9.13</org.codehaus.jackson.version>
<carbon.rest.api.version>4.2.2</carbon.rest.api.version>
Expand Down