UT for Rest lib 50/86850/1
authorjanani b <janani.b@huawei.com>
Thu, 2 May 2019 07:20:39 +0000 (12:50 +0530)
committerDan Timoney <dtimoney@att.com>
Thu, 2 May 2019 19:01:29 +0000 (19:01 +0000)
Added the lib test cases which will not cause jenkins delay

Issue-ID: CCSDK-1229

Change-Id: I1aff85ec3956fdcef806a9657ee3472a35b27f74
Signed-off-by: janani b <janani.b@huawei.com>
(cherry picked from commit d5fd5d487248a82af1536d562e5a55c1a9df80e6)

ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/BluePrintRestLibPropertyServiceTest.kt

index a85dc9a..37a797f 100644 (file)
@@ -20,7 +20,6 @@ package org.onap.ccsdk.cds.blueprintsprocessor.rest.service
 
 import com.fasterxml.jackson.databind.JsonNode
 import com.fasterxml.jackson.databind.ObjectMapper
-import org.junit.Ignore
 import org.junit.Test
 import org.junit.runner.RunWith
 import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintProperties
@@ -63,7 +62,6 @@ import kotlin.test.assertNotNull
     "blueprintsprocessor.restclient.ssl.sslKey=src/test/resources/keystore.p12",
     "blueprintsprocessor.restclient.ssl.sslKeyPassword=changeit"
 ])
-@Ignore
 class BluePrintRestLibPropertyServiceTest {
 
     @Autowired
@@ -215,5 +213,25 @@ class BluePrintRestLibPropertyServiceTest {
                 "eprintWebClientService")
     }
 
+    @Test
+    fun testBlueprintWebClientServiceWithJsonNode() {
+        val json: String = "{\n" +
+                "  \"type\" : \"ssl-basic-auth\",\n" +
+                "  \"url\" : \"https://localhost:8443\",\n" +
+                "  \"keyStoreInstance\" : \"PKCS12\",\n" +
+                "  \"sslTrust\" : \"src/test/resources/keystore.p12\",\n" +
+                "  \"sslTrustPassword\" : \"changeit\",\n" +
+                "  \"basicAuth\" : {\n" +
+                "    \"username\" : \"admin\",\n" +
+                "    \"password\" : \"cds\"\n" +
+                "  }\n" +
+                "}"
+        val mapper = ObjectMapper()
+        val actualObj: JsonNode = mapper.readTree(json)
+        val blueprintWebClientService = bluePrintRestLibPropertyService
+                .blueprintWebClientService(actualObj)
+        assertNotNull(blueprintWebClientService, "failed to create blu" +
+                "eprintWebClientService")
+    }
 }