summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules/commons/grpc-lib
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2019-11-18 14:13:12 +0000
committerGerrit Code Review <gerrit@onap.org>2019-11-18 14:13:12 +0000
commitdaab2a792144ffa728de67e24c801c3d0742c9b9 (patch)
tree2084df907ac21e60a13b53dcd51caa295bca496b /ms/blueprintsprocessor/modules/commons/grpc-lib
parentf1d758b6d4151d33b7717b477917cae223e035a6 (diff)
parentd425c6319a995402163c8868e9fe40f3d88f02ea (diff)
Merge "Convert component functions IT to UT."
Diffstat (limited to 'ms/blueprintsprocessor/modules/commons/grpc-lib')
-rw-r--r--ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BluePrintGrpcLibPropertyService.kt18
-rw-r--r--ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BluePrintGrpcLibPropertyServiceTest.kt6
2 files changed, 12 insertions, 12 deletions
diff --git a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BluePrintGrpcLibPropertyService.kt b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BluePrintGrpcLibPropertyService.kt
index f4933a3ad..fbc9ddd86 100644
--- a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BluePrintGrpcLibPropertyService.kt
+++ b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BluePrintGrpcLibPropertyService.kt
@@ -18,7 +18,7 @@
package org.onap.ccsdk.cds.blueprintsprocessor.grpc.service
import com.fasterxml.jackson.databind.JsonNode
-import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintProperties
+import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService
import org.onap.ccsdk.cds.blueprintsprocessor.grpc.*
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
import org.onap.ccsdk.cds.controllerblueprints.core.returnNullIfMissing
@@ -26,7 +26,7 @@ import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
import org.springframework.stereotype.Service
@Service(GRPCLibConstants.SERVICE_BLUEPRINT_GRPC_LIB_PROPERTY)
-open class BluePrintGrpcLibPropertyService(private var bluePrintProperties: BluePrintProperties) {
+open class BluePrintGrpcLibPropertyService(private var bluePrintPropertiesService: BluePrintPropertiesService) {
/** GRPC Server Lib Property Service */
fun grpcServerProperties(jsonNode: JsonNode): GrpcServerProperties {
@@ -44,7 +44,7 @@ open class BluePrintGrpcLibPropertyService(private var bluePrintProperties: Blue
}
fun grpcServerProperties(prefix: String): GrpcServerProperties {
- val type = bluePrintProperties.propertyBeanType(
+ val type = bluePrintPropertiesService.propertyBeanType(
"$prefix.type", String::class.java)
return when (type) {
GRPCLibConstants.TYPE_TOKEN_AUTH -> {
@@ -60,11 +60,11 @@ open class BluePrintGrpcLibPropertyService(private var bluePrintProperties: Blue
}
private fun tokenAuthGrpcServerProperties(prefix: String): TokenAuthGrpcServerProperties {
- return bluePrintProperties.propertyBeanType(prefix, TokenAuthGrpcServerProperties::class.java)
+ return bluePrintPropertiesService.propertyBeanType(prefix, TokenAuthGrpcServerProperties::class.java)
}
private fun tlsAuthGrpcServerProperties(prefix: String): TLSAuthGrpcServerProperties {
- return bluePrintProperties.propertyBeanType(prefix, TLSAuthGrpcServerProperties::class.java)
+ return bluePrintPropertiesService.propertyBeanType(prefix, TLSAuthGrpcServerProperties::class.java)
}
/** GRPC Client Lib Property Service */
@@ -101,7 +101,7 @@ open class BluePrintGrpcLibPropertyService(private var bluePrintProperties: Blue
}
fun grpcClientProperties(prefix: String): GrpcClientProperties {
- val type = bluePrintProperties.propertyBeanType(
+ val type = bluePrintPropertiesService.propertyBeanType(
"$prefix.type", String::class.java)
return when (type) {
GRPCLibConstants.TYPE_TOKEN_AUTH -> {
@@ -139,14 +139,14 @@ open class BluePrintGrpcLibPropertyService(private var bluePrintProperties: Blue
}
private fun tokenAuthGrpcClientProperties(prefix: String): TokenAuthGrpcClientProperties {
- return bluePrintProperties.propertyBeanType(prefix, TokenAuthGrpcClientProperties::class.java)
+ return bluePrintPropertiesService.propertyBeanType(prefix, TokenAuthGrpcClientProperties::class.java)
}
private fun tlsAuthGrpcClientProperties(prefix: String): TLSAuthGrpcClientProperties {
- return bluePrintProperties.propertyBeanType(prefix, TLSAuthGrpcClientProperties::class.java)
+ return bluePrintPropertiesService.propertyBeanType(prefix, TLSAuthGrpcClientProperties::class.java)
}
private fun basicAuthGrpcClientProperties(prefix: String): BasicAuthGrpcClientProperties {
- return bluePrintProperties.propertyBeanType(prefix, BasicAuthGrpcClientProperties::class.java)
+ return bluePrintPropertiesService.propertyBeanType(prefix, BasicAuthGrpcClientProperties::class.java)
}
} \ No newline at end of file
diff --git a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BluePrintGrpcLibPropertyServiceTest.kt b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BluePrintGrpcLibPropertyServiceTest.kt
index b7ddc1569..e4bfd5d7c 100644
--- a/ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BluePrintGrpcLibPropertyServiceTest.kt
+++ b/ms/blueprintsprocessor/modules/commons/grpc-lib/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/grpc/service/BluePrintGrpcLibPropertyServiceTest.kt
@@ -21,8 +21,8 @@ import com.fasterxml.jackson.databind.JsonNode
import com.fasterxml.jackson.databind.ObjectMapper
import org.junit.Test
import org.junit.runner.RunWith
-import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintProperties
-import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertyConfiguration
+import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService
+import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertyConfiguration
import org.onap.ccsdk.cds.blueprintsprocessor.grpc.*
import org.onap.ccsdk.cds.controllerblueprints.core.jsonAsJsonType
import org.springframework.beans.factory.annotation.Autowired
@@ -35,7 +35,7 @@ import kotlin.test.assertTrue
@RunWith(SpringRunner::class)
@ContextConfiguration(classes = [BluePrintGrpcLibConfiguration::class,
- BlueprintPropertyConfiguration::class, BluePrintProperties::class])
+ BluePrintPropertyConfiguration::class, BluePrintPropertiesService::class])
@TestPropertySource(properties =
["blueprintsprocessor.grpcclient.sample.type=basic-auth",
"blueprintsprocessor.grpcclient.sample.host=127.0.0.1",