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
@Test
fun testNodeComponentRemoteScriptExecutorType() {
- val nodeType = BlueprintTypes.nodeTypeComponentRemoteScriptExecutor()
+ val nodeType = BluePrintTypes.nodeTypeComponentRemoteScriptExecutor()
assertNotNull(nodeType, "failed to generate nodeType Component Remote Script Executor")
}
fun testComponentRemoteScriptExecutor() {
runBlocking {
/** Mock blueprint context */
- val blueprintContext = mockk<BlueprintContext>()
+ val blueprintContext = mockk<BluePrintContext>()
every { blueprintContext.rootPath } returns normalizedPathName("target")
every {
blueprintContext.nodeTemplateOperationImplementation(
)
} returns Implementation()
- val bluePrintRuntime = mockk<DefaultBlueprintRuntimeService>("1234")
+ val bluePrintRuntime = mockk<DefaultBluePrintRuntimeService>("1234")
every { bluePrintRuntime.bluePrintContext() } returns blueprintContext
val mockExecutionServiceInput = mockExecutionServiceInput(bluePrintRuntime)
}
}
- private fun mockExecutionServiceInput(bluePrintRuntime: DefaultBlueprintRuntimeService): ExecutionServiceInput {
+ private fun mockExecutionServiceInput(bluePrintRuntime: DefaultBluePrintRuntimeService): ExecutionServiceInput {
val mapper = ObjectMapper()
val requestNode = mapper.createObjectNode()
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()
return createExecutionServiceOutputProto(
executionServiceInput.commonHeader.toProto(),
executionServiceInput.actionIdentifiers.toProto(),
- createStatus(BlueprintConstants.STATUS_SUCCESS, 200),
+ createStatus(BluePrintConstants.STATUS_SUCCESS, 200),
responsePayload
)
}