Commit d0825862 authored by harshit aggarwal's avatar harshit aggarwal
Browse files

Removing trailing slash

parent 015f4336
Pipeline #8161 passed with stages
in 13 minutes and 54 seconds
...@@ -350,8 +350,8 @@ public class IntegrationTestStepDefs implements En { ...@@ -350,8 +350,8 @@ public class IntegrationTestStepDefs implements En {
JsonElement jsonBody = new Gson().fromJson(payload, JsonElement.class); JsonElement jsonBody = new Gson().fromJson(payload, JsonElement.class);
payload = new Gson().toJson(jsonBody); payload = new Gson().toJson(jsonBody);
this.context.setInputPayload(payload); this.context.setInputPayload(payload);
// Changing environment variable name to STORAGE_URL to maintain consistancy in naming // Changing environment variable name to STORAGE_URL to maintain consistency in naming
String storageURL = System.getProperty("STORAGE_URL", System.getenv("STORAGE_URL")); String storageURL = System.getProperty("STORAGE_URL", System.getenv("STORAGE_URL")).replaceFirst("/*$", "");
HttpRequest httpRequest = HttpRequest.builder().url(storageURL + AutomationConstants.POST_ENDPOINT) HttpRequest httpRequest = HttpRequest.builder().url(storageURL + AutomationConstants.POST_ENDPOINT)
.body(jsonBody.toString()).httpMethod(HttpRequest.PUT).requestHeaders(this.context.getAuthHeaders()) .body(jsonBody.toString()).httpMethod(HttpRequest.PUT).requestHeaders(this.context.getAuthHeaders())
.build(); .build();
...@@ -361,8 +361,9 @@ public class IntegrationTestStepDefs implements En { ...@@ -361,8 +361,9 @@ public class IntegrationTestStepDefs implements En {
} }
private void deleteFromStorage(String recordId) { private void deleteFromStorage(String recordId) {
String storageURL = System.getProperty("STORAGE_URL", System.getenv("STORAGE_URL")) String storageURL = System.getProperty("STORAGE_URL", System.getenv("STORAGE_URL")).replaceFirst("/*$", "")
+ AutomationConstants.DELETE_ENDPOINT + recordId; + AutomationConstants.DELETE_ENDPOINT + recordId;
HttpRequest httpRequest = HttpRequest.builder().url(storageURL) HttpRequest httpRequest = HttpRequest.builder().url(storageURL)
.httpMethod(HttpRequest.DELETE).requestHeaders(this.context.getAuthHeaders()) .httpMethod(HttpRequest.DELETE).requestHeaders(this.context.getAuthHeaders())
.build(); .build();
...@@ -377,7 +378,7 @@ public class IntegrationTestStepDefs implements En { ...@@ -377,7 +378,7 @@ public class IntegrationTestStepDefs implements En {
} }
private String storageGetResponse(String recordId) { private String storageGetResponse(String recordId) {
String reqURI = System.getProperty("STORAGE_URL", System.getenv("STORAGE_URL")) String reqURI = System.getProperty("STORAGE_URL", System.getenv("STORAGE_URL")).replaceFirst("/*$", "")
+ AutomationConstants.GET_ENDPOINT + recordId; + AutomationConstants.GET_ENDPOINT + recordId;
HttpRequest httpRequest = HttpRequest.builder().url(reqURI).httpMethod(HttpRequest.GET) HttpRequest httpRequest = HttpRequest.builder().url(reqURI).httpMethod(HttpRequest.GET)
.requestHeaders(this.context.getAuthHeaders()).build(); .requestHeaders(this.context.getAuthHeaders()).build();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment