summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules
diff options
context:
space:
mode:
Diffstat (limited to 'ms/blueprintsprocessor/modules')
-rw-r--r--ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandler.kt5
-rw-r--r--ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandlerTest.kt5
2 files changed, 10 insertions, 0 deletions
diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandler.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandler.kt
index 7600979f8..714cf3a46 100644
--- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandler.kt
+++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandler.kt
@@ -24,6 +24,7 @@ import io.grpc.stub.StreamObserver
import kotlinx.coroutines.runBlocking
import org.onap.ccsdk.cds.blueprintsprocessor.designer.api.handler.BluePrintModelHandler
import org.onap.ccsdk.cds.controllerblueprints.common.api.CommonHeader
+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.BluePrintConstants
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
@@ -246,6 +247,7 @@ open class BluePrintManagementGRPCHandler(
.setStatus(
Status.newBuilder()
.setTimestamp(currentTimestamp())
+ .setEventType(EventType.EVENT_COMPONENT_EXECUTED)
.setMessage(BluePrintConstants.STATUS_SUCCESS)
.setCode(200)
.build()
@@ -265,6 +267,7 @@ open class BluePrintManagementGRPCHandler(
Status.newBuilder()
.setTimestamp(currentTimestamp())
.setMessage(BluePrintConstants.STATUS_SUCCESS)
+ .setEventType(EventType.EVENT_COMPONENT_EXECUTED)
.setCode(200)
.build()
)
@@ -284,6 +287,7 @@ open class BluePrintManagementGRPCHandler(
Status.newBuilder()
.setTimestamp(currentTimestamp())
.setMessage(BluePrintConstants.STATUS_FAILURE)
+ .setEventType(EventType.EVENT_COMPONENT_FAILURE)
.setErrorMessage("Error : $message \n Details: ${error.errorMessageOrDefault()}")
.setCode(code)
.build()
@@ -305,6 +309,7 @@ open class BluePrintManagementGRPCHandler(
Status.newBuilder()
.setTimestamp(currentTimestamp())
.setMessage(BluePrintConstants.STATUS_FAILURE)
+ .setEventType(EventType.EVENT_COMPONENT_FAILURE)
.setErrorMessage("Error : ${errorPayload.message}")
.setCode(errorPayload.code)
.build()
diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandlerTest.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandlerTest.kt
index d6694de9e..a2f208367 100644
--- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandlerTest.kt
+++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BluePrintManagementGRPCHandlerTest.kt
@@ -29,6 +29,7 @@ import org.onap.ccsdk.cds.blueprintsprocessor.grpc.TokenAuthGrpcClientProperties
import org.onap.ccsdk.cds.blueprintsprocessor.grpc.service.TokenAuthGrpcClientService
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
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
import org.onap.ccsdk.cds.controllerblueprints.core.compress
import org.onap.ccsdk.cds.controllerblueprints.core.deleteDir
@@ -94,6 +95,7 @@ class BluePrintManagementGRPCHandlerTest {
bootstrapOutput.status.message!!.contentEquals(BluePrintConstants.STATUS_SUCCESS),
"failed to get success status"
)
+ assertEquals(EventType.EVENT_COMPONENT_EXECUTED, bootstrapOutput.status.eventType)
assertEquals(id, bootstrapOutput.commonHeader.requestId)
}
@@ -109,6 +111,7 @@ class BluePrintManagementGRPCHandlerTest {
output.status.message!!.contentEquals(BluePrintConstants.STATUS_SUCCESS),
"failed to get success status"
)
+ assertEquals(EventType.EVENT_COMPONENT_EXECUTED, output.status.eventType)
assertEquals(id, output.commonHeader.requestId)
val downloadId = "123_download"
@@ -120,6 +123,7 @@ class BluePrintManagementGRPCHandlerTest {
downloadOutput.status.message!!.contentEquals(BluePrintConstants.STATUS_SUCCESS),
"failed to get success status"
)
+ assertEquals(EventType.EVENT_COMPONENT_EXECUTED, downloadOutput.status.eventType)
assertNotNull(downloadOutput.fileChunk?.chunk, "failed to get cba file chunks")
assertEquals(downloadId, downloadOutput.commonHeader.requestId)
}
@@ -137,6 +141,7 @@ class BluePrintManagementGRPCHandlerTest {
"failed to get success status"
)
assertEquals(id, output.commonHeader.requestId)
+ assertEquals(EventType.EVENT_COMPONENT_EXECUTED, output.status.eventType)
val removeReq = createRemoveInputRequest(id)
output = blockingStub.removeBlueprint(removeReq)