aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org
diff options
context:
space:
mode:
authorAlexis de Talhouët <adetalhouet89@gmail.com>2019-03-08 13:41:18 -0500
committerAlexis de Talhouët <adetalhouet89@gmail.com>2019-03-11 15:59:44 -0400
commit349643f7bec1b793e3427e97c79f0a123a20ca37 (patch)
tree706e376dea089ce25a2f8ab37aa62305ddf46a5f /ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org
parent4a79859fcae8769b95e99bf7ef10c9006fc9c7b0 (diff)
Enhance / fix REST resource resolution
- 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 <adetalhouet89@gmail.com>
Diffstat (limited to 'ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org')
-rw-r--r--ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/rest/service/RestClientServiceTest.kt13
1 files changed, 6 insertions, 7 deletions
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 25821966..4fa82df2 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<String, String>()
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")
}