diff options
author | 2019-05-13 15:49:03 -0400 | |
---|---|---|
committer | 2019-05-15 16:26:34 -0400 | |
commit | 9eb8b8a88bfac860a94b62b203b00c64330a1be7 (patch) | |
tree | 1e7403f7a53599f7708d172ae61b3dbc0e1b55ac /ms/blueprintsprocessor/modules/commons/rest-lib/src/test | |
parent | 250b5b2a4ad4020df9c0dd053743d28616e28485 (diff) |
BlueprintWebClientService: added return status
Issue-ID: CCSDK-1331
Change-Id: I8dab8ad4eaebf1863f11c4d38c52cf7f64b0a4d5
Signed-off-by: Oleg Mitsura <oleg.mitsura@amdocs.com>
Diffstat (limited to 'ms/blueprintsprocessor/modules/commons/rest-lib/src/test')
-rw-r--r-- | ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestClientServiceTest.kt | 22 |
1 files changed, 11 insertions, 11 deletions
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 93eb12dd0..21d05e620 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 @@ -99,7 +99,7 @@ class RestClientServiceTest { .blueprintWebClientService("sample") val response = restClientService.exchangeResource( HttpMethod.PATCH.name, "/sample/name", "") - assertEquals("Patch request successful", response, + assertEquals("Patch request successful", response.body, "failed to get patch response") } @@ -111,7 +111,7 @@ class RestClientServiceTest { headers["X-Transaction-Id"] = "1234" val response = restClientService.exchangeResource(HttpMethod.GET.name, "/sample/name", "") - assertNotNull(response, "failed to get response") + assertNotNull(response.body, "failed to get response") } @Test @@ -130,7 +130,7 @@ class RestClientServiceTest { runBlocking { val get = async(start = CoroutineStart.LAZY) { restClientService.exchangeNB(HttpMethod.GET.name, - "/sample/basic", "")} + "/sample/basic", "").body} get.start() res = get.await() } @@ -163,32 +163,32 @@ class RestClientServiceTest { val get1 = async(start = CoroutineStart.LAZY) { restClientService.exchangeNB(HttpMethod.GET.name, "/sample/aai/v14/business/customers", "", headers, - Customer::class.java)} + Customer::class.java).body} val get2 = async(start = CoroutineStart.LAZY) { restClientService.exchangeNB(HttpMethod.GET.name, "/sample/aai/v14/business/customers", "", headers, - Customer::class.java)} + Customer::class.java).body} val post = async(start = CoroutineStart.LAZY) { restClientService.exchangeNB(HttpMethod.POST.name, "/sample/aai/v14/business/customers", post1, headers, - String::class.java)} + String::class.java).body} val put = async(start = CoroutineStart.LAZY) { restClientService.exchangeNB(HttpMethod.PUT.name, "/sample/aai/v14/business/customers", post1, headers, - String::class.java)} + String::class.java).body} val patch = async(start = CoroutineStart.LAZY) { restClientService.exchangeNB(HttpMethod.PATCH.name, "/sample/aai/v14/business/customers", post1, headers, - String::class.java)} + String::class.java).body} val delete = async(start = CoroutineStart.LAZY) { restClientService.exchangeNB(HttpMethod.DELETE.name, "/sample/aai/v14/business/customers", "", headers, - String::class.java)} + String::class.java).body} get1.start() get2.start() @@ -346,7 +346,7 @@ class HttpServer { fun servletContainer(): ServletWebServerFactory { val connector = Connector(TomcatServletWebServerFactory.DEFAULT_PROTOCOL) - connector.setPort(8080) + connector.port = 8080 val tomcat = TomcatServletWebServerFactory() tomcat.addAdditionalTomcatConnectors(connector) @@ -361,4 +361,4 @@ data class Customer( val id: String, val name: String, val type: String, - val resource: String)
\ No newline at end of file + val resource: String) |