aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk
diff options
context:
space:
mode:
Diffstat (limited to 'ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk')
-rw-r--r--ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentRemoteScriptExecutorTest.kt24
-rw-r--r--ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/MockBluePrintProcessingServer.kt (renamed from ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/MockBlueprintProcessingServer.kt)8
-rw-r--r--ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/StreamingRemoteExecutionServiceTest.kt8
-rw-r--r--ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/scripts/AbstractComponentFunctionTest.kt34
4 files changed, 37 insertions, 37 deletions
diff --git a/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentRemoteScriptExecutorTest.kt b/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentRemoteScriptExecutorTest.kt
index 5ef62d0bc..b3a0a5892 100644
--- a/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentRemoteScriptExecutorTest.kt
+++ b/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentRemoteScriptExecutorTest.kt
@@ -32,15 +32,15 @@ import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.StepData
import org.onap.ccsdk.cds.blueprintsprocessor.core.utils.createExecutionServiceOutputProto
import org.onap.ccsdk.cds.blueprintsprocessor.core.utils.createStatus
import org.onap.ccsdk.cds.blueprintsprocessor.core.utils.toProto
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes
import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive
import org.onap.ccsdk.cds.controllerblueprints.core.data.Implementation
import org.onap.ccsdk.cds.controllerblueprints.core.dsl.serviceTemplate
import org.onap.ccsdk.cds.controllerblueprints.core.jsonAsJsonType
import org.onap.ccsdk.cds.controllerblueprints.core.normalizedPathName
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext
-import org.onap.ccsdk.cds.controllerblueprints.core.service.DefaultBlueprintRuntimeService
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext
+import org.onap.ccsdk.cds.controllerblueprints.core.service.DefaultBluePrintRuntimeService
import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput
import kotlin.test.assertNotNull
@@ -48,7 +48,7 @@ class ComponentRemoteScriptExecutorTest {
@Test
fun testNodeComponentRemoteScriptExecutorType() {
- val nodeType = BlueprintTypes.nodeTypeComponentRemoteScriptExecutor()
+ val nodeType = BluePrintTypes.nodeTypeComponentRemoteScriptExecutor()
assertNotNull(nodeType, "failed to generate nodeType Component Remote Script Executor")
}
@@ -96,7 +96,7 @@ class ComponentRemoteScriptExecutorTest {
fun testComponentRemoteScriptExecutor() {
runBlocking {
/** Mock blueprint context */
- val blueprintContext = mockk<BlueprintContext>()
+ val blueprintContext = mockk<BluePrintContext>()
every { blueprintContext.rootPath } returns normalizedPathName("target")
every {
blueprintContext.nodeTemplateOperationImplementation(
@@ -104,7 +104,7 @@ class ComponentRemoteScriptExecutorTest {
)
} returns Implementation()
- val bluePrintRuntime = mockk<DefaultBlueprintRuntimeService>("1234")
+ val bluePrintRuntime = mockk<DefaultBluePrintRuntimeService>("1234")
every { bluePrintRuntime.bluePrintContext() } returns blueprintContext
val mockExecutionServiceInput = mockExecutionServiceInput(bluePrintRuntime)
@@ -130,7 +130,7 @@ class ComponentRemoteScriptExecutorTest {
}
}
- private fun mockExecutionServiceInput(bluePrintRuntime: DefaultBlueprintRuntimeService): ExecutionServiceInput {
+ private fun mockExecutionServiceInput(bluePrintRuntime: DefaultBluePrintRuntimeService): ExecutionServiceInput {
val mapper = ObjectMapper()
val requestNode = mapper.createObjectNode()
@@ -138,10 +138,10 @@ class ComponentRemoteScriptExecutorTest {
requestNode.put("type", "grpc")
val operationInputs = hashMapOf<String, JsonNode>()
- operationInputs[BlueprintConstants.PROPERTY_CURRENT_NODE_TEMPLATE] = "remote-execute".asJsonPrimitive()
- operationInputs[BlueprintConstants.PROPERTY_CURRENT_INTERFACE] =
+ operationInputs[BluePrintConstants.PROPERTY_CURRENT_NODE_TEMPLATE] = "remote-execute".asJsonPrimitive()
+ operationInputs[BluePrintConstants.PROPERTY_CURRENT_INTERFACE] =
"ComponentRemoteScriptExecutor".asJsonPrimitive()
- operationInputs[BlueprintConstants.PROPERTY_CURRENT_OPERATION] = "process".asJsonPrimitive()
+ operationInputs[BluePrintConstants.PROPERTY_CURRENT_OPERATION] = "process".asJsonPrimitive()
operationInputs[ComponentRemoteScriptExecutor.INPUT_SELECTOR] = "remote-script-executor".asJsonPrimitive()
operationInputs[ComponentRemoteScriptExecutor.INPUT_BLUEPRINT_NAME] = "sample-blueprint".asJsonPrimitive()
@@ -205,7 +205,7 @@ class ComponentRemoteScriptExecutorTest {
return createExecutionServiceOutputProto(
executionServiceInput.commonHeader.toProto(),
executionServiceInput.actionIdentifiers.toProto(),
- createStatus(BlueprintConstants.STATUS_SUCCESS, 200),
+ createStatus(BluePrintConstants.STATUS_SUCCESS, 200),
responsePayload
)
}
diff --git a/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/MockBlueprintProcessingServer.kt b/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/MockBluePrintProcessingServer.kt
index 7ac6134d9..8edea46f6 100644
--- a/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/MockBlueprintProcessingServer.kt
+++ b/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/MockBluePrintProcessingServer.kt
@@ -25,13 +25,13 @@ import org.onap.ccsdk.cds.controllerblueprints.common.api.EventType
import org.onap.ccsdk.cds.controllerblueprints.common.api.Status
import org.onap.ccsdk.cds.controllerblueprints.core.MDCContext
import org.onap.ccsdk.cds.controllerblueprints.core.logger
-import org.onap.ccsdk.cds.controllerblueprints.processing.api.BlueprintProcessingServiceGrpc
+import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc
import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput
import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput
-private val log = logger(MockBlueprintProcessingServer::class)
+private val log = logger(MockBluePrintProcessingServer::class)
-class MockBlueprintProcessingServer : BlueprintProcessingServiceGrpc.BlueprintProcessingServiceImplBase() {
+class MockBluePrintProcessingServer : BluePrintProcessingServiceGrpc.BluePrintProcessingServiceImplBase() {
override fun process(responseObserver: StreamObserver<ExecutionServiceOutput>): StreamObserver<ExecutionServiceInput> {
@@ -96,7 +96,7 @@ fun main() {
val server = ServerBuilder
.forPort(50052)
.intercept(GrpcServerLoggingInterceptor())
- .addService(MockBlueprintProcessingServer())
+ .addService(MockBluePrintProcessingServer())
.build()
server.start()
log.info("GRPC Serve started(${server.isShutdown}) on port(${server.port})...")
diff --git a/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/StreamingRemoteExecutionServiceTest.kt b/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/StreamingRemoteExecutionServiceTest.kt
index 0d3e42a5e..28e2b11b2 100644
--- a/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/StreamingRemoteExecutionServiceTest.kt
+++ b/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/StreamingRemoteExecutionServiceTest.kt
@@ -35,8 +35,8 @@ import org.junit.Test
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ACTION_MODE_SYNC
import org.onap.ccsdk.cds.blueprintsprocessor.grpc.GRPCLibConstants
import org.onap.ccsdk.cds.blueprintsprocessor.grpc.TokenAuthGrpcClientProperties
-import org.onap.ccsdk.cds.blueprintsprocessor.grpc.service.BlueprintGrpcLibPropertyService
-import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts.MockBlueprintProcessingServer
+import org.onap.ccsdk.cds.blueprintsprocessor.grpc.service.BluePrintGrpcLibPropertyService
+import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts.MockBluePrintProcessingServer
import org.onap.ccsdk.cds.controllerblueprints.common.api.ActionIdentifiers
import org.onap.ccsdk.cds.controllerblueprints.common.api.CommonHeader
import org.onap.ccsdk.cds.controllerblueprints.common.api.EventType
@@ -67,11 +67,11 @@ class StreamingRemoteExecutionServiceTest {
@ExperimentalCoroutinesApi
@FlowPreview
fun testStreamingChannel() {
- grpcCleanup.register(serverBuilder.addService(MockBlueprintProcessingServer()).build().start())
+ grpcCleanup.register(serverBuilder.addService(MockBluePrintProcessingServer()).build().start())
val channel = grpcCleanup.register(channelBuilder.maxInboundMessageSize(1024).build())
runBlocking {
- val bluePrintGrpcLibPropertyService = BlueprintGrpcLibPropertyService(mockk())
+ val bluePrintGrpcLibPropertyService = BluePrintGrpcLibPropertyService(mockk())
val streamingRemoteExecutionService = StreamingRemoteExecutionServiceImpl(bluePrintGrpcLibPropertyService)
diff --git a/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/scripts/AbstractComponentFunctionTest.kt b/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/scripts/AbstractComponentFunctionTest.kt
index 3438821c7..b5757812c 100644
--- a/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/scripts/AbstractComponentFunctionTest.kt
+++ b/ms/blueprintsprocessor/modules/services/execution-service/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/scripts/AbstractComponentFunctionTest.kt
@@ -34,23 +34,23 @@ import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ActionIdentifiers
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.CommonHeader
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.StepData
-import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BlueprintClusterService
+import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BluePrintClusterService
import org.onap.ccsdk.cds.blueprintsprocessor.core.service.CDS_LOCK_GROUP
import org.onap.ccsdk.cds.blueprintsprocessor.core.service.ClusterLock
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractComponentFunction
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ComponentFunctionScriptingService
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.nodeTypeComponentScriptExecutor
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintError
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintTypes
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintError
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes
import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive
import org.onap.ccsdk.cds.controllerblueprints.core.asJsonType
import org.onap.ccsdk.cds.controllerblueprints.core.data.Implementation
import org.onap.ccsdk.cds.controllerblueprints.core.data.LockAssignment
import org.onap.ccsdk.cds.controllerblueprints.core.normalizedPathName
-import org.onap.ccsdk.cds.controllerblueprints.core.scripts.BlueprintScriptsServiceImpl
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext
-import org.onap.ccsdk.cds.controllerblueprints.core.service.DefaultBlueprintRuntimeService
+import org.onap.ccsdk.cds.controllerblueprints.core.scripts.BluePrintScriptsServiceImpl
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext
+import org.onap.ccsdk.cds.controllerblueprints.core.service.DefaultBluePrintRuntimeService
import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.test.context.ContextConfiguration
@@ -66,14 +66,14 @@ import kotlin.test.assertNotNull
@ContextConfiguration(
classes = [
ComponentFunctionScriptingService::class,
- BlueprintScriptsServiceImpl::class, DeprecatedBlueprintJythonService::class
+ BluePrintScriptsServiceImpl::class, DeprecatedBlueprintJythonService::class
]
)
class AbstractComponentFunctionTest {
- lateinit var bluePrintRuntimeService: DefaultBlueprintRuntimeService
- lateinit var blueprintContext: BlueprintContext
- lateinit var blueprintClusterService: BlueprintClusterService
+ lateinit var bluePrintRuntimeService: DefaultBluePrintRuntimeService
+ lateinit var blueprintContext: BluePrintContext
+ lateinit var blueprintClusterService: BluePrintClusterService
@Autowired
lateinit var compSvc: ComponentFunctionScriptingService
@@ -92,7 +92,7 @@ class AbstractComponentFunctionTest {
)
} returns Implementation()
- every { bluePrintRuntimeService.getBlueprintError() } returns BlueprintError()
+ every { bluePrintRuntimeService.getBluePrintError() } returns BluePrintError()
}
@Test
@@ -152,7 +152,7 @@ class AbstractComponentFunctionTest {
@Test
fun testComponentScriptExecutorNodeType() {
- val componentScriptExecutor = BlueprintTypes.nodeTypeComponentScriptExecutor()
+ val componentScriptExecutor = BluePrintTypes.nodeTypeComponentScriptExecutor()
assertNotNull(componentScriptExecutor.interfaces, "failed to get interface operations")
}
@@ -277,7 +277,7 @@ class AbstractComponentFunctionTest {
/**
* Mocked input for abstract function test.
*/
- private fun getMockedInput(bluePrintRuntime: DefaultBlueprintRuntimeService):
+ private fun getMockedInput(bluePrintRuntime: DefaultBluePrintRuntimeService):
ExecutionServiceInput {
val mapper = ObjectMapper()
@@ -286,11 +286,11 @@ class AbstractComponentFunctionTest {
rootNode.put("type", "rest")
val operationInputs = hashMapOf<String, JsonNode>()
- operationInputs[BlueprintConstants.PROPERTY_CURRENT_NODE_TEMPLATE] =
+ operationInputs[BluePrintConstants.PROPERTY_CURRENT_NODE_TEMPLATE] =
"activate-restconf".asJsonPrimitive()
- operationInputs[BlueprintConstants.PROPERTY_CURRENT_INTERFACE] =
+ operationInputs[BluePrintConstants.PROPERTY_CURRENT_INTERFACE] =
"interfaceName".asJsonPrimitive()
- operationInputs[BlueprintConstants.PROPERTY_CURRENT_OPERATION] =
+ operationInputs[BluePrintConstants.PROPERTY_CURRENT_OPERATION] =
"operationName".asJsonPrimitive()
operationInputs["dynamic-properties"] = rootNode