diff options
author | KAPIL SINGAL <ks220y@att.com> | 2020-11-12 16:10:26 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-11-12 16:10:26 +0000 |
commit | 17707e6531d3986e43020725a3de06351d387226 (patch) | |
tree | 6c1ab9e26a4c926a1697722346b2ec8cb4a63788 /ms/blueprintsprocessor | |
parent | 31d0437598040ac7b71f340278a6592f949404c2 (diff) | |
parent | 8ab6b99ad6acc07978977bba42c335dbcdf23116 (diff) |
Merge "Remove URI encoding in BlueprintWebClientService"
Diffstat (limited to 'ms/blueprintsprocessor')
2 files changed, 6 insertions, 22 deletions
diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BlueprintWebClientService.kt b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BlueprintWebClientService.kt index 9beacfcea..945d29850 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BlueprintWebClientService.kt +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BlueprintWebClientService.kt @@ -42,11 +42,9 @@ import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintIOUtils import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils import org.springframework.http.HttpHeaders import org.springframework.http.HttpMethod -import org.springframework.web.util.UriUtils import java.io.IOException import java.io.InputStream import java.nio.charset.Charset -import java.nio.charset.StandardCharsets interface BlueprintWebClientService { @@ -94,15 +92,14 @@ interface BlueprintWebClientService { * the difference is in convertToBasicHeaders vs basicHeaders */ val convertedHeaders: Array<BasicHeader> = convertToBasicHeaders(headers) - val encodedPath = UriUtils.encodeQuery(path, StandardCharsets.UTF_8.name()) return when (HttpMethod.resolve(methodType)) { - HttpMethod.DELETE -> delete(encodedPath, convertedHeaders, String::class.java) - HttpMethod.GET -> get(encodedPath, convertedHeaders, String::class.java) - HttpMethod.POST -> post(encodedPath, request, convertedHeaders, String::class.java) - HttpMethod.PUT -> put(encodedPath, request, convertedHeaders, String::class.java) - HttpMethod.PATCH -> patch(encodedPath, request, convertedHeaders, String::class.java) + HttpMethod.DELETE -> delete(path, convertedHeaders, String::class.java) + HttpMethod.GET -> get(path, convertedHeaders, String::class.java) + HttpMethod.POST -> post(path, request, convertedHeaders, String::class.java) + HttpMethod.PUT -> put(path, request, convertedHeaders, String::class.java) + HttpMethod.PATCH -> patch(path, request, convertedHeaders, String::class.java) else -> throw BluePrintProcessorException( - "Unsupported methodType($methodType) attempted on path($encodedPath)" + "Unsupported methodType($methodType) attempted on path($path)" ) } } diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestClientServiceTest.kt b/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestClientServiceTest.kt index 23ac1635b..1778eadbd 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestClientServiceTest.kt +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestClientServiceTest.kt @@ -132,19 +132,6 @@ class RestClientServiceTest { } @Test - fun testGetPathParamWithWhitespace() { - val restClientService = bluePrintRestLibPropertyService - .blueprintWebClientService("sample") - val response = restClientService.exchangeResource( - HttpMethod.GET.name, "/sample/path/id 3/get", "" - ) - assertEquals( - "path param id:id 3", response.body, - "failed to get query param response" - ) - } - - @Test fun testPatch() { val restClientService = bluePrintRestLibPropertyService .blueprintWebClientService("sample") |