aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions/blueprint-audit-status/src/test
diff options
context:
space:
mode:
authorKavitha P <pkavitha@aarnanetworks.com>2021-08-25 16:12:18 +0530
committerKAPIL SINGAL <ks220y@att.com>2021-08-27 16:58:22 +0000
commit35481027b3fdf251a3b520ab5b1ae89c7d2d0e34 (patch)
tree8fe9d3fe117005d54b31e1a136ad334e419268e4 /ms/blueprintsprocessor/functions/blueprint-audit-status/src/test
parent6b6f2360e4e60d681a5ba0fc05477f9ac9bea051 (diff)
CCSDK-3434 CBA workflow status store
Change-Id: Iaeac6fa534c569bbc152e6c8a78c2dd23b6c4b1a Signed-off-by: Kavitha P <pkavitha@aarnanetworks.com> Issue-ID: CCSDK-3434
Diffstat (limited to 'ms/blueprintsprocessor/functions/blueprint-audit-status/src/test')
-rw-r--r--ms/blueprintsprocessor/functions/blueprint-audit-status/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/workflow/audit/DatabaseStoreAuditServiceTest.kt270
-rw-r--r--ms/blueprintsprocessor/functions/blueprint-audit-status/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/workflow/audit/NoStoreAuditServiceTest.kt81
-rw-r--r--ms/blueprintsprocessor/functions/blueprint-audit-status/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/workflow/audit/TestDatabaseConfiguration.kt62
-rw-r--r--ms/blueprintsprocessor/functions/blueprint-audit-status/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/workflow/audit/db/BlueprintAuditStatusRepositoryTest.kt0
-rw-r--r--ms/blueprintsprocessor/functions/blueprint-audit-status/src/test/resources/application-test.properties36
-rw-r--r--ms/blueprintsprocessor/functions/blueprint-audit-status/src/test/resources/exec-serv-input/multistep-input.json23
-rw-r--r--ms/blueprintsprocessor/functions/blueprint-audit-status/src/test/resources/exec-serv-output/multistep-output.json26
7 files changed, 498 insertions, 0 deletions
diff --git a/ms/blueprintsprocessor/functions/blueprint-audit-status/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/workflow/audit/DatabaseStoreAuditServiceTest.kt b/ms/blueprintsprocessor/functions/blueprint-audit-status/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/workflow/audit/DatabaseStoreAuditServiceTest.kt
new file mode 100644
index 000000000..cd4fc75a7
--- /dev/null
+++ b/ms/blueprintsprocessor/functions/blueprint-audit-status/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/workflow/audit/DatabaseStoreAuditServiceTest.kt
@@ -0,0 +1,270 @@
+package org.onap.ccsdk.cds.blueprintsprocessor.functions.workflow.audit
+
+import io.mockk.every
+import io.mockk.mockk
+import kotlinx.coroutines.runBlocking
+import org.junit.Test
+import org.junit.runner.RunWith
+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.functions.workflow.audit.db.BlueprintAuditStatusRepository
+import org.onap.ccsdk.cds.blueprintsprocessor.functions.workflow.audit.db.BlueprintWorkflowAuditStatus
+import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration
+import org.springframework.context.annotation.ComponentScan
+import org.springframework.test.context.ContextConfiguration
+import org.springframework.test.context.TestPropertySource
+import org.springframework.test.context.junit4.SpringRunner
+import java.util.Date
+import kotlin.collections.ArrayList
+import kotlin.test.assertNotNull
+
+@RunWith(SpringRunner::class)
+@ContextConfiguration(
+ classes = [TestDatabaseConfiguration::class]
+)
+@TestPropertySource(locations = ["classpath:application-test.properties"])
+@ComponentScan(basePackages = ["org.onap.ccsdk.cds.blueprintsprocessor", "org.onap.ccsdk.cds.controllerblueprints"])
+@EnableAutoConfiguration
+class DatabaseStoreAuditServiceTest {
+
+ private val blueprintAuditStatusRepository =
+ mockk<BlueprintAuditStatusRepository>()
+
+ private val databaseStoreAuditService = DatabaseStoreAuditService(blueprintAuditStatusRepository)
+
+ @Test
+ fun storeExecutionInputTest() {
+ val executionServiceInput = JacksonUtils.readValueFromClassPathFile(
+ "exec-serv-input/multistep-input.json",
+ ExecutionServiceInput::class.java
+ )!!
+ val wfAudit1 = createWorkflowAuditStatusRecord(1000)
+ var testOuput: Long = 0
+ runBlocking {
+ every { blueprintAuditStatusRepository.saveAndFlush(any<BlueprintWorkflowAuditStatus>()) } returns wfAudit1
+ testOuput = databaseStoreAuditService.storeExecutionInput(executionServiceInput)
+ assertNotNull(testOuput, "failed to resolve the resources")
+ }
+ }
+
+ @Test
+ fun storeExecutionOutputTest() {
+ val executionServiceOutput = JacksonUtils.readValueFromClassPathFile(
+ "exec-serv-output/multistep-output.json",
+ ExecutionServiceOutput::class.java
+ )!!
+ val inputAudit = createWorkflowAuditStatusRecord(1001)
+ val outputAudit = createWorkflowAuditStatusOutputRecord(1001)
+
+ var testOutput: Long = 1001
+ runBlocking {
+ every { blueprintAuditStatusRepository.findById(testOutput) } returns inputAudit
+ every { blueprintAuditStatusRepository.saveAndFlush(any<BlueprintWorkflowAuditStatus>()) } returns outputAudit
+ databaseStoreAuditService.storeExecutionOutput(
+ testOutput,
+ "12345", executionServiceOutput
+ )
+ }
+ }
+
+ @Test(expected = Exception::class)
+ fun storeExecutionOutputErrorTest() {
+ val executionServiceOutput = JacksonUtils.readValueFromClassPathFile(
+ "exec-serv-output/multistep-output.json",
+ ExecutionServiceOutput::class.java
+ )!!
+ // val inputAudit = createWorkflowAuditStatusRecord(1001)
+ val outputAudit = createWorkflowAuditStatusOutputRecord(1001)
+
+ var testOutput: Long = -1
+ runBlocking {
+ every { blueprintAuditStatusRepository.findById(-1) } returns null
+ every { blueprintAuditStatusRepository.saveAndFlush(any<BlueprintWorkflowAuditStatus>()) } returns outputAudit
+ databaseStoreAuditService.storeExecutionOutput(
+ testOutput,
+ "12345", executionServiceOutput
+ )
+ }
+ }
+
+ @Test
+ fun getWorkflowStatusByRequestIdAndSubRequestIdTest() {
+ val inputAudit = createWorkflowAuditStatusList(1003)
+ val testRequestId: String = "ab543-3asd4"
+ val testSubRequestId: String = "81c9-4910"
+ runBlocking {
+ every {
+ blueprintAuditStatusRepository.findByRequestIdAndSubRequestId(testRequestId, testSubRequestId)
+ } returns inputAudit
+ assertNotNull(
+ inputAudit.get(0).blueprintName, "Blueprint Name should not be null"
+ )
+ assertNotNull(
+ inputAudit.get(0).blueprintVersion, "Blueprint should not be null"
+ )
+ assertNotNull(
+ inputAudit.get(0).requestId, "Request ID should not be null"
+ )
+ assertNotNull(
+ inputAudit.get(0).subRequestId, "Subrequest ID should not be null"
+ )
+ assertNotNull(
+ inputAudit.get(0).status, "Status should not be null"
+ )
+ assertNotNull(
+ inputAudit.get(0).startDate, "Start Date should not be null"
+ )
+ assertNotNull(
+ inputAudit.get(0).updatedBy, "Updatedby should not be null"
+ )
+ assertNotNull(
+ inputAudit.get(0).updatedDate, "updated Date should not be null"
+ )
+ assertNotNull(
+ inputAudit.get(0).originatorId, "Originator ID should not be null"
+ )
+ assertNotNull(
+ inputAudit.get(0).requestMode, "Request Mode should not be null"
+ )
+ assertNotNull(
+ inputAudit.get(0).id, "ID should not be null"
+ )
+ databaseStoreAuditService.getWorkflowStatusByRequestIdAndSubRequestId(testRequestId, testSubRequestId)
+ }
+ }
+
+ @Test
+ fun getWorkflowStatusByRequestIdTest() {
+ val inputAudit = createWorkflowAuditStatusList(1004)
+ val testRequestId: String = "ab543-3asd4"
+ runBlocking {
+ every { blueprintAuditStatusRepository.findByRequestId(testRequestId) } returns inputAudit
+ databaseStoreAuditService.getWorkflowStatusByRequestId(testRequestId)
+ }
+ }
+
+ private fun createWorkflowAuditStatusRecord(
+ id: Long
+ ): BlueprintWorkflowAuditStatus {
+
+ var blueprintWorkflowAuditStatus: BlueprintWorkflowAuditStatus =
+ BlueprintWorkflowAuditStatus()
+ blueprintWorkflowAuditStatus.id = id
+ blueprintWorkflowAuditStatus.originatorId = "SDNC_DG"
+ blueprintWorkflowAuditStatus.requestMode = "sync"
+ blueprintWorkflowAuditStatus.requestId = "ab543-3asd4"
+ blueprintWorkflowAuditStatus.subRequestId = "81c9-4910"
+ blueprintWorkflowAuditStatus.status = "In progress"
+ blueprintWorkflowAuditStatus.blueprintName = "multi-steps"
+ blueprintWorkflowAuditStatus.blueprintVersion = "1.0.0"
+ blueprintWorkflowAuditStatus.workflowName = "multi-steps-workflow"
+ blueprintWorkflowAuditStatus.updatedBy = DatabaseStoreAuditConstants.WORKFLOW_STATUS_UPDATEDBY
+ blueprintWorkflowAuditStatus.endDate = Date()
+ blueprintWorkflowAuditStatus.requestMode = "sync"
+ blueprintWorkflowAuditStatus.workflowTaskContent = "{\n" +
+ " \"multi-steps-workflow-request\": {\n" +
+ " \"multi-steps-workflow-properties\": {\n" +
+ " \"prop1\": \"testing\",\n" +
+ " \"prop2\": \"testing description\",\n" +
+ " \"prop3\": \"user name \",\n" +
+ " \"prop4\" : \"test project\"\n" +
+ " }\n" +
+ " }\n" +
+ " }"
+ blueprintWorkflowAuditStatus.workflowResponseContent = " "
+ return blueprintWorkflowAuditStatus
+ }
+
+ private fun createWorkflowAuditStatusOutputRecord(
+ id: Long
+ ): BlueprintWorkflowAuditStatus {
+
+ var blueprintWorkflowAuditStatus: BlueprintWorkflowAuditStatus =
+ BlueprintWorkflowAuditStatus()
+ blueprintWorkflowAuditStatus.id = id
+ blueprintWorkflowAuditStatus.originatorId = "SDNC_DG"
+ blueprintWorkflowAuditStatus.requestMode = "sync"
+ blueprintWorkflowAuditStatus.requestId = "ab543-3asd4"
+ blueprintWorkflowAuditStatus.subRequestId = "81c9-4910"
+ blueprintWorkflowAuditStatus.status = DatabaseStoreAuditConstants.WORKFLOW_STATUS_INPROGRESS
+ blueprintWorkflowAuditStatus.blueprintName = "multi-steps"
+ blueprintWorkflowAuditStatus.blueprintVersion = "1.0.0"
+ blueprintWorkflowAuditStatus.workflowName = "multi-steps-workflow"
+ blueprintWorkflowAuditStatus.updatedBy = "CBA"
+ blueprintWorkflowAuditStatus.requestMode = "sync"
+ blueprintWorkflowAuditStatus.workflowTaskContent = "{\n" +
+ " \"multi-steps-workflow-request\": {\n" +
+ " \"multi-steps-workflow-properties\": {\n" +
+ " \"prop1\": \"testing\",\n" +
+ " \"prop2\": \"testing description\",\n" +
+ " \"prop3\": \"user name \",\n" +
+ " \"prop4\" : \"test project\"\n" +
+ " }\n" +
+ " }\n" +
+ " }"
+ blueprintWorkflowAuditStatus.workflowResponseContent = "{\n" +
+ " \"correlationUUID\": null,\n" +
+ " \"commonHeader\": {\n" +
+ " \"timestamp\": \"2021-08-05T08:18:35.690Z\",\n" +
+ " \"originatorId\": \"SDNC_DG\",\n" +
+ " \"requestId\": \"ab543-3asd4\",\n" +
+ " \"subRequestId\": \"81c9-4910\",\n" +
+ " \"flags\": null\n" +
+ " },\n" +
+ " \"actionIdentifiers\": {\n" +
+ " \"blueprintName\": \"multi-steps\",\n" +
+ " \"blueprintVersion\": \"1.0.0\",\n" +
+ " \"actionName\": \"multi-steps-workflow\",\n" +
+ " \"mode\": \"sync\"\n" +
+ " },\n" +
+ " \"status\": {\n" +
+ " \"code\": 200,\n" +
+ " \"eventType\": \"EVENT_COMPONENT_EXECUTED\",\n" +
+ " \"timestamp\": \"2021-08-05T08:18:35.727Z\",\n" +
+ " \"errorMessage\": null,\n" +
+ " \"message\": \"success\"\n" +
+ " },\n" +
+ " \"payload\": {\n" +
+ " \"multi-steps-workflow-response\": {}\n" +
+ " }\n" +
+ "} "
+ return blueprintWorkflowAuditStatus
+ }
+
+ private fun createWorkflowAuditStatusList(
+ id: Long
+ ): List<BlueprintWorkflowAuditStatus> {
+
+ var blueprintWorkflowAuditStatus: BlueprintWorkflowAuditStatus =
+ BlueprintWorkflowAuditStatus()
+ blueprintWorkflowAuditStatus.id = id
+ blueprintWorkflowAuditStatus.originatorId = "SDNC_DG"
+ blueprintWorkflowAuditStatus.requestMode = "sync"
+ blueprintWorkflowAuditStatus.requestId = "ab543-3asd4"
+ blueprintWorkflowAuditStatus.subRequestId = "81c9-4910"
+ blueprintWorkflowAuditStatus.status = DatabaseStoreAuditConstants.WORKFLOW_STATUS_INPROGRESS
+ blueprintWorkflowAuditStatus.blueprintName = "multi-steps"
+ blueprintWorkflowAuditStatus.blueprintVersion = "1.0.0"
+ blueprintWorkflowAuditStatus.workflowName = "multi-steps-workflow"
+ blueprintWorkflowAuditStatus.updatedBy = DatabaseStoreAuditConstants.WORKFLOW_STATUS_UPDATEDBY
+ blueprintWorkflowAuditStatus.requestMode = "sync"
+ blueprintWorkflowAuditStatus.workflowTaskContent = "{\n" +
+ " \"multi-steps-workflow-request\": {\n" +
+ " \"multi-steps-workflow-properties\": {\n" +
+ " \"prop1\": \"testing\",\n" +
+ " \"prop2\": \"testing description\",\n" +
+ " \"prop3\": \"user name \",\n" +
+ " \"prop4\" : \"test project\"\n" +
+ " }\n" +
+ " }\n" +
+ " }"
+ blueprintWorkflowAuditStatus.workflowResponseContent = " "
+ var testList: ArrayList<BlueprintWorkflowAuditStatus> = ArrayList<BlueprintWorkflowAuditStatus>()
+ testList.add(blueprintWorkflowAuditStatus)
+ return testList
+ }
+}
+
+private infix fun Any.returns(nothing: Nothing?) {
+}
diff --git a/ms/blueprintsprocessor/functions/blueprint-audit-status/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/workflow/audit/NoStoreAuditServiceTest.kt b/ms/blueprintsprocessor/functions/blueprint-audit-status/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/workflow/audit/NoStoreAuditServiceTest.kt
new file mode 100644
index 000000000..16abe95d3
--- /dev/null
+++ b/ms/blueprintsprocessor/functions/blueprint-audit-status/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/workflow/audit/NoStoreAuditServiceTest.kt
@@ -0,0 +1,81 @@
+package org.onap.ccsdk.cds.blueprintsprocessor.functions.workflow.audit
+
+import io.mockk.mockk
+import kotlinx.coroutines.runBlocking
+import org.junit.Test
+import org.junit.runner.RunWith
+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.functions.workflow.audit.db.BlueprintAuditStatusRepository
+import org.onap.ccsdk.cds.blueprintsprocessor.functions.workflow.audit.db.BlueprintWorkflowAuditStatus
+import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration
+import org.springframework.context.annotation.ComponentScan
+import org.springframework.test.context.ContextConfiguration
+import org.springframework.test.context.TestPropertySource
+import org.springframework.test.context.junit4.SpringRunner
+import kotlin.test.assertEquals
+import kotlin.test.assertNotNull
+
+@RunWith(SpringRunner::class)
+@ContextConfiguration(
+ classes = [TestDatabaseConfiguration::class]
+)
+@TestPropertySource(locations = ["classpath:application-test.properties"])
+@ComponentScan(basePackages = ["org.onap.ccsdk.cds.blueprintsprocessor", "org.onap.ccsdk.cds.controllerblueprints"])
+@EnableAutoConfiguration
+class NoStoreAuditServiceTest {
+
+ private val blueprintAuditStatusRepository =
+ mockk<BlueprintAuditStatusRepository>()
+
+ private val storeAuditService = NoStoreAuditService(blueprintAuditStatusRepository)
+
+ @Test
+ fun storeExecutionInputTest() {
+ val executionServiceInput = JacksonUtils.readValueFromClassPathFile(
+ "exec-serv-input/multistep-input.json",
+ ExecutionServiceInput::class.java
+ )!!
+ var testOuput: Long = 0
+ runBlocking {
+ testOuput = storeAuditService.storeExecutionInput(executionServiceInput)
+ assertEquals(-1, testOuput, "Failed to resolve the workflow")
+ }
+ }
+
+ @Test
+ fun storeExecutionOutputTest() {
+ val executionServiceOutput = JacksonUtils.readValueFromClassPathFile(
+ "exec-serv-output/multistep-output.json",
+ ExecutionServiceOutput::class.java
+ )!!
+ var testOutput: Long = -1
+ runBlocking {
+ storeAuditService.storeExecutionOutput(
+ testOutput, "12345", executionServiceOutput
+ )
+ }
+ }
+
+ @Test
+ fun getWorkflowStatusByRequestIdAndSubRequestIdTest() {
+ val testRequestId: String = "ab543-3asd4"
+ val testSubRequestId: String = "81c9-4910"
+ var testList: List<BlueprintWorkflowAuditStatus>? = null
+ runBlocking {
+ testList = storeAuditService.getWorkflowStatusByRequestIdAndSubRequestId(testRequestId, testSubRequestId)
+ assertNotNull(testList, " Returned null instead of empty list ")
+ }
+ }
+
+ @Test
+ fun getWorkflowStatusByRequestIdTest() {
+ val testRequestId: String = "ab543-3asd4"
+ var testList: List<BlueprintWorkflowAuditStatus>? = null
+ runBlocking {
+ testList = storeAuditService.getWorkflowStatusByRequestId(testRequestId)
+ assertNotNull(testList, " Returned null instead of empty list ")
+ }
+ }
+}
diff --git a/ms/blueprintsprocessor/functions/blueprint-audit-status/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/workflow/audit/TestDatabaseConfiguration.kt b/ms/blueprintsprocessor/functions/blueprint-audit-status/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/workflow/audit/TestDatabaseConfiguration.kt
new file mode 100644
index 000000000..682b89155
--- /dev/null
+++ b/ms/blueprintsprocessor/functions/blueprint-audit-status/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/workflow/audit/TestDatabaseConfiguration.kt
@@ -0,0 +1,62 @@
+/*
+ * Copyright © 2021 Aarna Networks, Inc.
+ * All rights reserved.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.ccsdk.cds.blueprintsprocessor.functions.workflow.audit
+
+import org.onap.ccsdk.cds.blueprintsprocessor.db.BluePrintDBLibConfiguration
+import org.onap.ccsdk.cds.blueprintsprocessor.db.PrimaryDataSourceProperties
+import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.PrimaryDatabaseConfiguration
+import org.springframework.context.annotation.Bean
+import org.springframework.context.annotation.Configuration
+import org.springframework.context.annotation.Import
+import org.springframework.data.jpa.repository.config.EnableJpaAuditing
+import org.springframework.data.jpa.repository.config.EnableJpaRepositories
+import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean
+import org.springframework.transaction.PlatformTransactionManager
+import javax.sql.DataSource
+
+@Configuration
+@Import(BluePrintDBLibConfiguration::class)
+@EnableJpaRepositories(
+ basePackages = [
+ "org.onap.ccsdk.cds.blueprintsprocessor.db.primary",
+ "org.onap.ccsdk.cds.blueprintsprocessor.functions.workflow.audit"
+ ],
+ entityManagerFactoryRef = "primaryEntityManager",
+ transactionManagerRef = "primaryTransactionManager"
+)
+@EnableJpaAuditing
+open class TestDatabaseConfiguration(primaryDataSourceProperties: PrimaryDataSourceProperties) :
+ PrimaryDatabaseConfiguration(primaryDataSourceProperties) {
+
+ @Bean("primaryEntityManager")
+ open fun primaryEntityManager(): LocalContainerEntityManagerFactoryBean {
+ return primaryEntityManager(
+ "org.onap.ccsdk.cds.blueprintsprocessor.db.primary",
+ "org.onap.ccsdk.cds.blueprintsprocessor.functions.workflow.audit.db"
+ )
+ }
+
+ @Bean("primaryDataSource")
+ override fun primaryDataSource(): DataSource {
+ return super.primaryDataSource()
+ }
+
+ @Bean("primaryTransactionManager")
+ override fun primaryTransactionManager(): PlatformTransactionManager {
+ return super.primaryTransactionManager()
+ }
+}
diff --git a/ms/blueprintsprocessor/functions/blueprint-audit-status/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/workflow/audit/db/BlueprintAuditStatusRepositoryTest.kt b/ms/blueprintsprocessor/functions/blueprint-audit-status/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/workflow/audit/db/BlueprintAuditStatusRepositoryTest.kt
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/ms/blueprintsprocessor/functions/blueprint-audit-status/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/workflow/audit/db/BlueprintAuditStatusRepositoryTest.kt
diff --git a/ms/blueprintsprocessor/functions/blueprint-audit-status/src/test/resources/application-test.properties b/ms/blueprintsprocessor/functions/blueprint-audit-status/src/test/resources/application-test.properties
new file mode 100644
index 000000000..6a707b08e
--- /dev/null
+++ b/ms/blueprintsprocessor/functions/blueprint-audit-status/src/test/resources/application-test.properties
@@ -0,0 +1,36 @@
+#
+# Copyright © 2021 Aarna Networks, Inc.
+# All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+blueprintsprocessor.db.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1
+blueprintsprocessor.db.username=sa
+blueprintsprocessor.db.password=
+blueprintsprocessor.db.driverClassName=org.h2.Driver
+blueprintsprocessor.db.hibernateHbm2ddlAuto=create-drop
+blueprintsprocessor.db.hibernateDDLAuto=update
+blueprintsprocessor.db.hibernateNamingStrategy=org.hibernate.cfg.ImprovedNamingStrategy
+blueprintsprocessor.db.hibernateDialect=org.hibernate.dialect.H2Dialect
+# Controller Blueprints Core Configuration
+blueprintsprocessor.blueprintDeployPath=./target/blueprints/deploy
+blueprintsprocessor.blueprintWorkingPath=./target/blueprints/work
+blueprintsprocessor.blueprintArchivePath=./target/blueprints/archive
+
+# Error Managements
+error.catalog.applicationId=cds
+error.catalog.type=properties
+error.catalog.errorDefinitionDir=./../../../application/src/test/resources/
+
+# Python executor
+blueprints.processor.functions.python.executor.executionPath=./../../../../components/scripts/python/ccsdk_blueprints
+blueprints.processor.functions.python.executor.modulePaths=./../../../../components/scripts/python/ccsdk_blueprints
diff --git a/ms/blueprintsprocessor/functions/blueprint-audit-status/src/test/resources/exec-serv-input/multistep-input.json b/ms/blueprintsprocessor/functions/blueprint-audit-status/src/test/resources/exec-serv-input/multistep-input.json
new file mode 100644
index 000000000..8e2552c00
--- /dev/null
+++ b/ms/blueprintsprocessor/functions/blueprint-audit-status/src/test/resources/exec-serv-input/multistep-input.json
@@ -0,0 +1,23 @@
+{
+ "actionIdentifiers": {
+ "mode": "sync",
+ "blueprintName": "multi-steps",
+ "blueprintVersion": "1.0.0",
+ "actionName": "multi-steps-workflow"
+ },
+ "payload": {
+ "multi-steps-workflow-request": {
+ "multi-steps-workflow-properties": {
+ "prop1": "testing",
+ "prop2": "testing description",
+ "prop3": "user name ",
+ "prop4" : "test project"
+ }
+ }
+ },
+ "commonHeader": {
+ "subRequestId": "81c9-4910",
+ "requestId": "ab543-3asd4",
+ "originatorId": "SDNC_DG"
+ }
+} \ No newline at end of file
diff --git a/ms/blueprintsprocessor/functions/blueprint-audit-status/src/test/resources/exec-serv-output/multistep-output.json b/ms/blueprintsprocessor/functions/blueprint-audit-status/src/test/resources/exec-serv-output/multistep-output.json
new file mode 100644
index 000000000..ca12b893d
--- /dev/null
+++ b/ms/blueprintsprocessor/functions/blueprint-audit-status/src/test/resources/exec-serv-output/multistep-output.json
@@ -0,0 +1,26 @@
+{
+ "correlationUUID": null,
+ "commonHeader": {
+ "timestamp": "2021-08-05T08:18:35.690Z",
+ "originatorId": "SDNC_DG",
+ "requestId": "ab543-3asd4",
+ "subRequestId": "81c9-4910",
+ "flags": null
+ },
+ "actionIdentifiers": {
+ "blueprintName": "multi-steps",
+ "blueprintVersion": "1.0.0",
+ "actionName": "multi-steps-workflow",
+ "mode": "sync"
+ },
+ "status": {
+ "code": 200,
+ "eventType": "EVENT_COMPONENT_EXECUTED",
+ "timestamp": "2021-08-05T08:18:35.727Z",
+ "errorMessage": null,
+ "message": "success"
+ },
+ "payload": {
+ "multi-steps-workflow-response": {}
+ }
+}