summaryrefslogtreecommitdiffstats
path: root/appc-config/appc-data-services/provider/src/test
diff options
context:
space:
mode:
authorGeorge, Lina (lg941u) <lg941u@att.com>2018-01-03 00:35:33 -0500
committerPatrick Brady <pb071s@att.com>2018-01-03 20:12:19 +0000
commit5a49cac6ffc172bc9fdb3b9d13311915c9952204 (patch)
tree56b95c5983862f4c9ba6f6282fd432b411242ddc /appc-config/appc-data-services/provider/src/test
parentcaa5768a32a385bf7997029929f29fe3b156348e (diff)
Updates to config data services bundle
Issue-ID: APPC-350 Change-Id: Id5738986a40f8c094c0ce2fc0033d378796733cf Signed-off-by: George, Lina (lg941u) <lg941u@att.com>
Diffstat (limited to 'appc-config/appc-data-services/provider/src/test')
-rw-r--r--appc-config/appc-data-services/provider/src/test/java/org/onap/appc/data/services/db/TestConfigResourceNode.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/appc-config/appc-data-services/provider/src/test/java/org/onap/appc/data/services/db/TestConfigResourceNode.java b/appc-config/appc-data-services/provider/src/test/java/org/onap/appc/data/services/db/TestConfigResourceNode.java
index fb44e8799..76ddbdcdf 100644
--- a/appc-config/appc-data-services/provider/src/test/java/org/onap/appc/data/services/db/TestConfigResourceNode.java
+++ b/appc-config/appc-data-services/provider/src/test/java/org/onap/appc/data/services/db/TestConfigResourceNode.java
@@ -24,6 +24,7 @@
package org.onap.appc.data.services.db;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import static org.junit.Assert.assertFalse;
@@ -34,6 +35,13 @@ import org.onap.appc.data.services.node.ConfigResourceNode;
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import org.onap.ccsdk.sli.core.sli.SvcLogicException;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.JsonNodeFactory;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+
public class TestConfigResourceNode {
@Ignore("Test is taking 60 seconds")
@@ -159,6 +167,25 @@ public class TestConfigResourceNode {
}
@Test
+ public void testProcessCapabilitiesForVMLevel () throws Exception {
+ //{"capabilities":{"vnfc":[],"vm":[{"ConfigureTest":["SSC","MMSC"]}],"vf-module":[],"vnf":["ConfigModify","HealthCheck"]}}
+ SvcLogicContext ctx = new SvcLogicContext();
+ ConfigResourceNode node = new ConfigResourceNode();
+ String findCapability="Restart";
+ JsonNode subCapabilities = JsonNodeFactory.instance.objectNode();
+ String subCaps= "[{\"Restart\":[\"SSC\",\"MMC\"]},{\"Rebuild\":[\"SSC\"]},{\"Migrate\":[\"SSC\"]},{\"Snapshot\":[\"SSC\"]},{\"Start\":[\"SSC\"]},{\"Stop\":[\"SSC\"]}]";
+ ObjectMapper m = new ObjectMapper();
+ subCapabilities = m.readTree(subCaps);
+ String vServerId="testServer";
+ ctx.setAttribute("tmp.vnfInfo.vm.vnfc.vnfc-function-code", "MMC");
+ ctx.setAttribute("tmp.vnfInfo.vm.vnfc.vnfc-name","testVnfc") ;
+ node.processCapabilitiesForVMLevel( vServerId, ctx,
+ findCapability, subCapabilities);
+ String result=ctx.getAttribute("capabilities");
+ assertEquals(result,"Supported");
+ }
+
+ @Test
public void testcheckIfCapabilityCheckNeeded () throws Exception {
ConfigResourceNode node = new ConfigResourceNode();
String findCapability="Start";