aboutsummaryrefslogtreecommitdiffstats
path: root/appc-config
diff options
context:
space:
mode:
authorSandeep J <sandeejh@in.ibm.com>2018-08-07 16:02:18 +0530
committerTakamune Cho <tc012c@att.com>2018-08-07 15:22:40 +0000
commitf66c2480d558298e4c7ce94d02c643e91e885c3c (patch)
tree207b7822efe2c0b0b4b954dbc9bc30a744a378f0 /appc-config
parent2678c12a4091b0815b5b42efab8e8aba9e841638 (diff)
Added test cases to ConfigResourceNodeTest.java
to increase code coverage Issue-ID: APPC-1086 Change-Id: Iebffd1a614c286f50fca9b3159107d6e08a06670 Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
Diffstat (limited to 'appc-config')
-rw-r--r--appc-config/appc-data-services/provider/src/test/java/org/onap/appc/data/services/node/ConfigResourceNodeTest.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/appc-config/appc-data-services/provider/src/test/java/org/onap/appc/data/services/node/ConfigResourceNodeTest.java b/appc-config/appc-data-services/provider/src/test/java/org/onap/appc/data/services/node/ConfigResourceNodeTest.java
index 776acda64..bdb2b7cc4 100644
--- a/appc-config/appc-data-services/provider/src/test/java/org/onap/appc/data/services/node/ConfigResourceNodeTest.java
+++ b/appc-config/appc-data-services/provider/src/test/java/org/onap/appc/data/services/node/ConfigResourceNodeTest.java
@@ -155,6 +155,31 @@ public class ConfigResourceNodeTest {
configResourceNode.getVnfcReference(inParams, contextMock);
verify(contextMock).setAttribute(anyString(), eq(AppcDataServiceConstant.OUTPUT_STATUS_SUCCESS));
}
+
+ @Test
+ public void testGetCapability() throws Exception {
+ DGGeneralDBService dbServiceMock = new MockDbServiceBuilder().build();
+ ConfigResourceNode configResourceNode = new ConfigResourceNode(dbServiceMock);
+ contextMock.setAttribute("responsePrefix", "testResponsePrefix");
+ contextMock.setAttribute("caplevel", "testCapLevel");
+ contextMock.setAttribute("checkCapability", "testCheckCapability");
+ contextMock.setAttribute("vServerId", "testVServerId");
+ contextMock.setAttribute("vnf-type", "testVnfType");
+ configResourceNode.getCapability(inParams, contextMock);
+ verify(contextMock).setAttribute(anyString(), eq(AppcDataServiceConstant.OUTPUT_STATUS_SUCCESS));
+ }
+
+ @Test
+ public void testGetConfigFilesByVnfVmNCategory() throws Exception {
+ DGGeneralDBService dbServiceMock = new MockDbServiceBuilder().build();
+ ConfigResourceNode configResourceNode = new ConfigResourceNode(dbServiceMock);
+ contextMock.setAttribute("responsePrefix", "testResponsePrefix");
+ contextMock.setAttribute("fileCategory", "testFileCategory");
+ contextMock.setAttribute("vnfId", "testVnfId");
+ contextMock.setAttribute("vmName", "testVmName");
+ configResourceNode.getConfigFilesByVnfVmNCategory(inParams, contextMock);
+ verify(contextMock).setAttribute(anyString(), eq(AppcDataServiceConstant.OUTPUT_STATUS_SUCCESS));
+ }
@Test
public void should_add_attribute_with_success_if_save_config_files_succeed() throws SvcLogicException {