aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions/resource-resolution/src/test
diff options
context:
space:
mode:
authorJozsef Csongvai <jozsef.csongvai@bell.ca>2020-03-03 10:08:59 -0500
committerKAPIL SINGAL <ks220y@att.com>2020-03-03 17:26:58 +0000
commit2fce8bf2891f3ce472f4b06d09d0e987fbc44149 (patch)
treecaae1d72abdf28e575ddc4f3dc923f189119b90d /ms/blueprintsprocessor/functions/resource-resolution/src/test
parentd0e90690108b30b4571a61f987c0d8c7d52df5da (diff)
Add properties to ResolutionSummary
Also wrapping ResolutionSummary response to ease integration with SDNC. Issue-ID: CCSDK-2038 Signed-off-by: Jozsef Csongvai <jozsef.csongvai@bell.ca> Change-Id: Ic1b8959e22ef795065d37664fb60f100af235a90
Diffstat (limited to 'ms/blueprintsprocessor/functions/resource-resolution/src/test')
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt3
-rw-r--r--ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtilsTest.kt36
2 files changed, 26 insertions, 13 deletions
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt
index 0a12540d4..d5c43184e 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/ResourceResolutionServiceTest.kt
@@ -256,7 +256,8 @@ class ResourceResolutionServiceTest {
props
)
}.let {
- val list = JacksonUtils.getListFromJson(it, ResolutionSummary::class.java)
+ val summaries = JacksonUtils.jsonNode(it)["resolution-summary"]
+ val list = JacksonUtils.getListFromJsonNode(summaries, ResolutionSummary::class.java)
assertEquals(list.size, 3)
}
}
diff --git a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtilsTest.kt b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtilsTest.kt
index da3b9c23b..9df8fb7d7 100644
--- a/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtilsTest.kt
+++ b/ms/blueprintsprocessor/functions/resource-resolution/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/resource/resolution/utils/ResourceAssignmentUtilsTest.kt
@@ -167,23 +167,35 @@ class ResourceAssignmentUtilsTest {
properties = mutableMapOf("resolved-payload" to JacksonUtils.jsonNode("{\"mock\": true}"))
}
resourceDefinition.sources = mutableMapOf("input" to nodeTemplate)
+ resourceDefinition.property = PropertyDefinition().apply {
+ this.description = "pnf-id"
+ this.metadata = mutableMapOf("aai-path" to "//path/in/aai")
+ }
val result = ResourceAssignmentUtils.generateResolutionSummaryData(
listOf(resourceAssignment), mapOf("pnf-id" to resourceDefinition))
assertEquals("""
- [{
- "name":"pnf-id",
- "value":null,
- "required":null,
- "type":"string",
- "key-identifiers":[],
- "dictionary-name":"pnf-id",
- "request-payload":{"mock":true},
- "dictionary-source":"input",
- "status":null,
- "message":null
- }]
+ {
+ "resolution-summary":[
+ {
+ "name":"pnf-id",
+ "value":null,
+ "required":null,
+ "type":"string",
+ "key-identifiers":[],
+ "dictionary-description":"pnf-id",
+ "dictionary-metadata":[
+ {"name":"aai-path","value":"//path/in/aai"}
+ ],
+ "dictionary-name":"pnf-id",
+ "dictionary-source":"input",
+ "request-payload":{"mock":true},
+ "status":null,
+ "message":null
+ }
+ ]
+ }
""".replace("\n|\\s".toRegex(), ""), result)
}