From 1a1d3654858304cfceb277b68c0ea7c48cb569ce Mon Sep 17 00:00:00 2001 From: Alexis de Talhouët Date: Fri, 8 Mar 2019 13:41:18 -0500 Subject: Enhance / fix REST resource resolution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - provide sync web client - add support for VERB - add support for payload - fix URI resolution from input-key-mapping Change-Id: Id4f1973a15778ad4f2ab0f7e2a4b2c61054a234d Issue-ID: CCSDK-1131 Signed-off-by: Alexis de Talhouët --- .../rest/service/RestClientServiceTest.kt | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org') diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/rest/service/RestClientServiceTest.kt b/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/rest/service/RestClientServiceTest.kt index 25821966f..4fa82df22 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/rest/service/RestClientServiceTest.kt +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/rest/service/RestClientServiceTest.kt @@ -24,6 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.autoconfigure.EnableAutoConfiguration import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration import org.springframework.boot.test.context.SpringBootTest +import org.springframework.http.HttpMethod import org.springframework.test.context.ContextConfiguration import org.springframework.test.context.TestPropertySource import org.springframework.test.context.junit4.SpringRunner @@ -39,11 +40,10 @@ import kotlin.test.assertNotNull @ContextConfiguration(classes = [BluePrintRestLibConfiguration::class, BlueprintPropertyConfiguration::class, SampleController::class, BluePrintProperties::class, BluePrintProperties::class]) @TestPropertySource(properties = -["server.port=9111", - "blueprintsprocessor.restclient.sample.type=basic-auth", - "blueprintsprocessor.restclient.sample.url=http://127.0.0.1:9111", - "blueprintsprocessor.restclient.sample.userId=sampleuser", - "blueprintsprocessor.restclient.sample.token=sampletoken"]) +["blueprintsprocessor.restclient.sample.type=basic-auth", + "blueprintsprocessor.restclient.sample.url=http://127.0.0.1:8080", + "blueprintsprocessor.restclient.sample.username=sampleuser", + "blueprintsprocessor.restclient.sample.password=sampletoken"]) class RestClientServiceTest { @Autowired @@ -51,11 +51,10 @@ class RestClientServiceTest { @Test fun testBaseAuth() { - val restClientService = bluePrintRestLibPropertyService.blueprintWebClientService("sample") val headers = mutableMapOf() headers["X-Transaction-Id"] = "1234" - val response = restClientService.getResource("/sample/name", headers, String::class.java) + val response = restClientService.exchangeResource(HttpMethod.GET.name, "/sample/name", "") assertNotNull(response, "failed to get response") } -- cgit 1.2.3-korg