import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.StepData
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.componentScriptExecutor
+import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.nodeTypeComponentScriptExecutor
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.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.utils.JacksonUtils
-import org.onap.ccsdk.cds.controllerblueprints.core.scripts.BluePrintScriptsServiceImpl
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.test.context.ContextConfiguration
import org.springframework.test.context.junit4.SpringRunner
every { blueprintContext.rootPath } returns normalizedPathName("target")
}
- /**
- * Tests the abstract component functionality.
- */
@Test
fun testAbstractComponent() {
runBlocking {
}
}
- /**
- * Tests the abstract script component functionality.
- */
+ @Test
+ fun testComponentFunctionPayload() {
+ val sampleComponent = SampleComponent()
+ sampleComponent.workflowName = "sample-action"
+ sampleComponent.executionServiceInput = JacksonUtils.readValueFromClassPathFile(
+ "payload/requests/sample-execution-request.json", ExecutionServiceInput::class.java)!!
+ val payload = sampleComponent.requestPayload()
+ assertNotNull(payload, "failed to get payload")
+ val data = sampleComponent.requestPayloadActionProperty("data")?.first()
+ assertNotNull(data, "failed to get payload request action data")
+ }
+
@Test
fun testAbstractScriptComponent() {
runBlocking {
@Test
fun testComponentScriptExecutorNodeType() {
- val componentScriptExecutor = BluePrintTypes.componentScriptExecutor()
+ val componentScriptExecutor = BluePrintTypes.nodeTypeComponentScriptExecutor()
assertNotNull(componentScriptExecutor.interfaces, "failed to get interface operations")
}
+
}