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 {
JsonElement jsonBody = new Gson().fromJson(payload, JsonElement.class);
payload = new Gson().toJson(jsonBody);
this.context.setInputPayload(payload);
// Changing environment variable name to STORAGE_URL to maintain consistancy in naming
String storageURL = System.getProperty("STORAGE_URL", System.getenv("STORAGE_URL"));
// Changing environment variable name to STORAGE_URL to maintain consistency in naming
String storageURL = System.getProperty("STORAGE_URL", System.getenv("STORAGE_URL")).replaceFirst("/*$", "");
HttpRequest httpRequest = HttpRequest.builder().url(storageURL + AutomationConstants.POST_ENDPOINT)
.body(jsonBody.toString()).httpMethod(HttpRequest.PUT).requestHeaders(this.context.getAuthHeaders())
.build();
......@@ -361,8 +361,9 @@ public class IntegrationTestStepDefs implements En {
}
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;
HttpRequest httpRequest = HttpRequest.builder().url(storageURL)
.httpMethod(HttpRequest.DELETE).requestHeaders(this.context.getAuthHeaders())
.build();
......@@ -377,7 +378,7 @@ public class IntegrationTestStepDefs implements En {
}
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;
HttpRequest httpRequest = HttpRequest.builder().url(reqURI).httpMethod(HttpRequest.GET)
.requestHeaders(this.context.getAuthHeaders()).build();
......
Markdown is supported
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