Revert "Renaming Files having BluePrint to have Blueprint"
[ccsdk/cds.git] / ms / blueprintsprocessor / modules / services / workflow-service / src / test / kotlin / org / onap / ccsdk / cds / blueprintsprocessor / services / workflow / BluePrintWorkflowExecutionServiceImplTest.kt
@@ -31,19 +31,19 @@ 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.ExecutionServiceOutput
-import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BlueprintClusterService
+import org.onap.ccsdk.cds.blueprintsprocessor.core.service.BluePrintClusterService
 import org.onap.ccsdk.cds.blueprintsprocessor.services.workflow.mock.MockComponentFunction
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintConstants
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintError
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintError
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
 import org.onap.ccsdk.cds.controllerblueprints.core.asJsonType
 import org.onap.ccsdk.cds.controllerblueprints.core.data.Step
 import org.onap.ccsdk.cds.controllerblueprints.core.data.Workflow
-import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BlueprintWorkflowExecutionService
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintContext
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintRuntimeService
-import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintMetadataUtils
+import org.onap.ccsdk.cds.controllerblueprints.core.interfaces.BluePrintWorkflowExecutionService
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintContext
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintRuntimeService
+import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintMetadataUtils
 import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
 import org.springframework.beans.factory.annotation.Autowired
 import org.springframework.boot.test.mock.mockito.MockBean
@@ -55,18 +55,18 @@ import kotlin.test.assertNotNull
 
 @RunWith(SpringRunner::class)
 @ContextConfiguration(classes = [WorkflowServiceConfiguration::class])
-class BlueprintWorkflowExecutionServiceImplTest {
+class BluePrintWorkflowExecutionServiceImplTest {
 
     @Autowired
-    lateinit var bluePrintWorkflowExecutionService: BlueprintWorkflowExecutionService<ExecutionServiceInput, ExecutionServiceOutput>
+    lateinit var bluePrintWorkflowExecutionService: BluePrintWorkflowExecutionService<ExecutionServiceInput, ExecutionServiceOutput>
 
     @MockBean
-    lateinit var bluePrintClusterService: BlueprintClusterService
+    lateinit var bluePrintClusterService: BluePrintClusterService
 
     @Before
     fun init() {
-        mockkObject(BlueprintDependencyService)
-        every { BlueprintDependencyService.applicationContext.getBean(any()) } returns MockComponentFunction()
+        mockkObject(BluePrintDependencyService)
+        every { BluePrintDependencyService.applicationContext.getBean(any()) } returns MockComponentFunction()
     }
 
     @After
@@ -75,9 +75,9 @@ class BlueprintWorkflowExecutionServiceImplTest {
     }
 
     @Test
-    fun testBlueprintWorkflowExecutionService() {
+    fun testBluePrintWorkflowExecutionService() {
         runBlocking {
-            val bluePrintRuntimeService = BlueprintMetadataUtils.getBlueprintRuntime(
+            val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime(
                 "1234",
                 "./../../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration"
             )
@@ -88,20 +88,20 @@ class BlueprintWorkflowExecutionServiceImplTest {
             )!!
 
             val executionServiceOutput = bluePrintWorkflowExecutionService
-                .executeBlueprintWorkflow(bluePrintRuntimeService, executionServiceInput, hashMapOf())
+                .executeBluePrintWorkflow(bluePrintRuntimeService, executionServiceInput, hashMapOf())
 
             assertNotNull(executionServiceOutput, "failed to get response")
             assertEquals(
-                BlueprintConstants.STATUS_SUCCESS, executionServiceOutput.status.message,
+                BluePrintConstants.STATUS_SUCCESS, executionServiceOutput.status.message,
                 "failed to get successful response"
             )
         }
     }
 
     @Test
-    fun testImperativeBlueprintWorkflowExecutionService() {
+    fun testImperativeBluePrintWorkflowExecutionService() {
         runBlocking {
-            val bluePrintRuntimeService = BlueprintMetadataUtils.getBlueprintRuntime(
+            val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime(
                 "1234",
                 "./../../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration"
             )
@@ -112,11 +112,11 @@ class BlueprintWorkflowExecutionServiceImplTest {
             )!!
 
             val executionServiceOutput = bluePrintWorkflowExecutionService
-                .executeBlueprintWorkflow(bluePrintRuntimeService, executionServiceInput, hashMapOf())
+                .executeBluePrintWorkflow(bluePrintRuntimeService, executionServiceInput, hashMapOf())
 
             assertNotNull(executionServiceOutput, "failed to get response")
             assertEquals(
-                BlueprintConstants.STATUS_SUCCESS, executionServiceOutput.status.message,
+                BluePrintConstants.STATUS_SUCCESS, executionServiceOutput.status.message,
                 "failed to get successful response"
             )
         }
@@ -124,9 +124,9 @@ class BlueprintWorkflowExecutionServiceImplTest {
 
     @Test
     fun `Blueprint fails on missing workflowName-parameters with a useful message`() {
-        assertFailsWith(exceptionClass = BlueprintProcessorException::class) {
+        assertFailsWith(exceptionClass = BluePrintProcessorException::class) {
             runBlocking {
-                val bluePrintRuntimeService = BlueprintMetadataUtils.getBlueprintRuntime(
+                val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime(
                     "1234",
                     "./../../../../../components/model-catalog/blueprint-model/test-blueprint/baseconfiguration"
                 )
@@ -138,7 +138,7 @@ class BlueprintWorkflowExecutionServiceImplTest {
                     )!!
 
                 val executionServiceOutput = bluePrintWorkflowExecutionService
-                    .executeBlueprintWorkflow(bluePrintRuntimeService, executionServiceInput, hashMapOf())
+                    .executeBluePrintWorkflow(bluePrintRuntimeService, executionServiceInput, hashMapOf())
             }
         }
     }
@@ -146,11 +146,11 @@ class BlueprintWorkflowExecutionServiceImplTest {
     @Test
     fun `Should handle errors from resolve workflow output`() {
         val imperativeWorkflowExecutionService: ImperativeWorkflowExecutionService = mockk()
-        val bluePrintWorkflowExecutionServiceImpl = BlueprintWorkflowExecutionServiceImpl(
+        val bluePrintWorkflowExecutionServiceImpl = BluePrintWorkflowExecutionServiceImpl(
             mockk(), mockk(), imperativeWorkflowExecutionService
         )
-        val bluePrintRuntimeService: BlueprintRuntimeService<MutableMap<String, JsonNode>> = mockk()
-        val bluePrintContext: BlueprintContext = mockk()
+        val bluePrintRuntimeService: BluePrintRuntimeService<MutableMap<String, JsonNode>> = mockk()
+        val bluePrintContext: BluePrintContext = mockk()
         val executionServiceInput = ExecutionServiceInput().apply {
             this.actionIdentifiers = ActionIdentifiers().apply { this.actionName = "config-assign" }
             this.commonHeader = CommonHeader()
@@ -159,7 +159,7 @@ class BlueprintWorkflowExecutionServiceImplTest {
         val workflow = Workflow().apply {
             this.steps = mutableMapOf("one" to Step(), "two" to Step())
         }
-        val blueprintError = BlueprintError()
+        val blueprintError = BluePrintError()
 
         every { bluePrintRuntimeService.bluePrintContext() } returns bluePrintContext
         every { bluePrintRuntimeService.assignWorkflowInputs(any(), any()) } returns Unit
@@ -169,13 +169,13 @@ class BlueprintWorkflowExecutionServiceImplTest {
         } throws RuntimeException("failed to resolve property...")
         every {
             runBlocking {
-                imperativeWorkflowExecutionService.executeBlueprintWorkflow(any(), any(), any())
+                imperativeWorkflowExecutionService.executeBluePrintWorkflow(any(), any(), any())
             }
         } returns ExecutionServiceOutput()
-        every { bluePrintRuntimeService.getBlueprintError() } returns blueprintError
+        every { bluePrintRuntimeService.getBluePrintError() } returns blueprintError
 
         runBlocking {
-            val output = bluePrintWorkflowExecutionServiceImpl.executeBlueprintWorkflow(
+            val output = bluePrintWorkflowExecutionServiceImpl.executeBluePrintWorkflow(
                 bluePrintRuntimeService, executionServiceInput, mutableMapOf()
             )
             assertEquals("failed to resolve property...", blueprintError.allErrors()[0])