aboutsummaryrefslogtreecommitdiffstats
path: root/components/core/src/test/kotlin
diff options
context:
space:
mode:
authorMuthuramalingam, Brinda Santh <bs2796@att.com>2019-01-16 20:17:24 -0500
committerMuthuramalingam, Brinda Santh <bs2796@att.com>2019-01-16 20:17:24 -0500
commiteb66a76bb2917d89f95bd0577661daed4bd3f9dc (patch)
treef7578cd3a36fbb066e470b438e791c86bf72eaf9 /components/core/src/test/kotlin
parenta630b5cdb3bab6d80703a4c1843058b11b977fb5 (diff)
Implement resolve NodeTemplate Capability property
Change-Id: I2e1de34d5c2465f1f59eeab044f1883e2d1d4ff6 Issue-ID: CCSDK-959 Signed-off-by: Muthuramalingam, Brinda Santh <bs2796@att.com>
Diffstat (limited to 'components/core/src/test/kotlin')
-rw-r--r--components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt37
1 files changed, 22 insertions, 15 deletions
diff --git a/components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt b/components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt
index c01b14b3..02148f08 100644
--- a/components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt
+++ b/components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/service/BluePrintRuntimeServiceTest.kt
@@ -39,7 +39,7 @@ class BluePrintRuntimeServiceTest {
private val log: EELFLogger = EELFManager.getInstance().getLogger(this::class.toString())
@Test
- fun testResolveNodeTemplateProperties() {
+ fun `test Resolve NodeTemplate Properties`() {
log.info("************************ testResolveNodeTemplateProperties **********************")
val bluePrintRuntimeService = getBluePrintRuntimeService()
@@ -49,25 +49,31 @@ class BluePrintRuntimeServiceTest {
val inputNode: JsonNode = JacksonUtils.jsonNodeFromFile(inputDataPath)
bluePrintRuntimeService.assignInputs(inputNode)
- val propContext: MutableMap<String, JsonNode> = bluePrintRuntimeService.resolveNodeTemplateProperties("activate-process")
+ val propContext: MutableMap<String, JsonNode> = bluePrintRuntimeService
+ .resolveNodeTemplateProperties("activate-process")
assertNotNull(propContext, "Failed to populate interface property values")
}
@Test
- fun testResolveNodeTemplateCapabilityProperties() {
+ fun `test resolve NodeTemplate Capability Properties`() {
log.info("************************ testResolveNodeTemplateRequirementProperties **********************")
- //TODO
- }
+ val bluePrintRuntimeService = getBluePrintRuntimeService()
- @Test
- fun testResolveNodeTemplateRequirementProperties() {
- log.info("************************ testResolveNodeTemplateRequirementProperties **********************")
- //TODO
+ val executionContext = bluePrintRuntimeService.getExecutionContext()
+
+ BluePrintRuntimeUtils.assignInputsFromClassPathFile(bluePrintRuntimeService.bluePrintContext(),
+ "data/default-context.json", executionContext)
+
+ val capProperties = bluePrintRuntimeService.resolveNodeTemplateCapabilityProperties("sample-netconf-device",
+ "netconf")
+ assertNotNull(capProperties, "Failed to populate capability property values")
+ assertEquals(capProperties["target-ip-address"], JacksonUtils.jsonNodeFromObject("localhost"), "Failed to populate parameter target-ip-address")
+ assertEquals(capProperties["port-number"], JacksonUtils.jsonNodeFromObject(830), "Failed to populate parameter port-number")
}
@Test
- fun testResolveNodeTemplateInterfaceOperationInputs() {
+ fun `test Resolve NodeTemplate Interface Operation Inputs`() {
log.info("************************ testResolveNodeTemplateInterfaceOperationInputs **********************")
val bluePrintRuntimeService = getBluePrintRuntimeService()
@@ -77,16 +83,17 @@ class BluePrintRuntimeServiceTest {
BluePrintRuntimeUtils.assignInputsFromClassPathFile(bluePrintRuntimeService.bluePrintContext(),
"data/default-context.json", executionContext)
- val inContext: MutableMap<String, JsonNode> = bluePrintRuntimeService.resolveNodeTemplateInterfaceOperationInputs("resource-assignment",
- "ResourceAssignmentComponent", "process")
+ val inContext: MutableMap<String, JsonNode> = bluePrintRuntimeService
+ .resolveNodeTemplateInterfaceOperationInputs("resource-assignment",
+ "ResourceAssignmentComponent", "process")
assertNotNull(inContext, "Failed to populate interface input property values")
assertEquals(inContext["action-name"], JacksonUtils.jsonNodeFromObject("sample-action"), "Failed to populate parameter action-name")
assertEquals(inContext["request-id"], JacksonUtils.jsonNodeFromObject("12345"), "Failed to populate parameter action-name")
- }
+ }
@Test
- fun testResolveNodeTemplateInterfaceOperationOutputs() {
+ fun `test Resolve NodeTemplate Interface Operation Outputs`() {
log.info("************************ testResolveNodeTemplateInterfaceOperationOutputs **********************")
val bluePrintRuntimeService = getBluePrintRuntimeService()
@@ -107,7 +114,7 @@ class BluePrintRuntimeServiceTest {
}
@Test
- fun testNodeTemplateContextProperty() {
+ fun `test NodeTemplate Context Property`() {
log.info("************************ testNodeTemplateContextProperty **********************")
val bluePrintRuntimeService = getBluePrintRuntimeService()