aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/utils/BluePrintMappingTests.kt
diff options
context:
space:
mode:
Diffstat (limited to 'ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/utils/BluePrintMappingTests.kt')
-rw-r--r--ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/utils/BluePrintMappingTests.kt46
1 files changed, 3 insertions, 43 deletions
diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/utils/BluePrintMappingTests.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/utils/BluePrintMappingTests.kt
index 2e4ba2755..770e4a9b3 100644
--- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/utils/BluePrintMappingTests.kt
+++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/utils/BluePrintMappingTests.kt
@@ -1,17 +1,12 @@
package org.onap.ccsdk.apps.blueprintsprocessor.selfservice.api.utils
-import com.fasterxml.jackson.databind.ObjectMapper
-import com.google.protobuf.ListValue
-import com.google.protobuf.NullValue
-import com.google.protobuf.Struct
-import com.google.protobuf.Value
-import com.google.protobuf.util.JsonFormat
import org.junit.Assert
import org.junit.Test
import org.junit.runner.RunWith
import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.Flags
import org.onap.ccsdk.apps.controllerblueprints.common.api.ActionIdentifiers
import org.onap.ccsdk.apps.controllerblueprints.common.api.CommonHeader
+import org.onap.ccsdk.apps.controllerblueprints.common.api.EventType
import org.onap.ccsdk.apps.controllerblueprints.common.api.Flag
import org.springframework.test.context.junit4.SpringRunner
import java.text.SimpleDateFormat
@@ -53,7 +48,7 @@ class BluePrintMappingsTest {
val status = org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.Status()
status.code = 400
status.errorMessage = "Concurrent modification exception"
- status.eventType = "Update"
+ status.eventType = EventType.EVENT_COMPONENT_PROCESSING.name
status.message = "Error uploading data"
status.timestamp = dateForTest
return status
@@ -66,7 +61,7 @@ class BluePrintMappingsTest {
Assert.assertEquals(status.code, status2.code)
Assert.assertEquals(status.errorMessage, status2.errorMessage)
- Assert.assertEquals(status.eventType, status2.eventType)
+ Assert.assertEquals(status.eventType, status2.eventType.name)
Assert.assertEquals(status.message, status2.message)
Assert.assertEquals(status.timestamp.toString(), status2.timestamp)
}
@@ -134,39 +129,4 @@ class BluePrintMappingsTest {
Assert.assertEquals(actionIdentifiers.blueprintVersion, actionIdentifiers2.blueprintVersion)
Assert.assertEquals(actionIdentifiers.mode, actionIdentifiers2.mode)
}
-
- @Test
- fun testStructToJava() {
- val struct = Struct.newBuilder().putAllFields(createValues()).build()
- val struct2 = struct.toJava()
-
- val mapper = ObjectMapper()
-
- Assert.assertEquals(JsonFormat.printer().print(struct).replace(" ", "").replace("\r",""),
- mapper.writerWithDefaultPrettyPrinter().writeValueAsString(struct2).replace(" ", "").replace("\r",""))
- }
-
- fun createValues(): Map<String, Value> {
- val map = mutableMapOf<String, Value>()
-
- val boolValue = Value.newBuilder().setBoolValue(true).build()
- val stringValue = Value.newBuilder().setStringValue("string").build()
- val doubleValue = Value.newBuilder().setNumberValue(Double.MAX_VALUE).build()
- val jsonValue = Value.newBuilder().setStringValue("{\"bblah\": \"bbblo\"}").build()
- val listValue = Value.newBuilder().setListValue(ListValue.newBuilder().addValues(boolValue).addValues(boolValue).build()).build()
- val nullValue = Value.newBuilder().setNullValue(NullValue.NULL_VALUE).build()
-
- map.put("bool", boolValue)
- map.put("string", stringValue)
- map.put("doublbe", doubleValue)
- map.put("json", jsonValue)
- map.put("list", listValue)
- map.put("null", nullValue)
-
- val structValue = Value.newBuilder().setStructValue(Struct.newBuilder().putAllFields(map).build()).build()
-
- map.put("struct", structValue)
-
- return map
- }
} \ No newline at end of file