added test case to ConfigResourceNodeTest.java 77/59177/1
authorSandeep J <sandeejh@in.ibm.com>
Mon, 6 Aug 2018 11:37:16 +0000 (17:07 +0530)
committerSandeep J <sandeejh@in.ibm.com>
Mon, 6 Aug 2018 11:37:29 +0000 (17:07 +0530)
to increase code coverage

Issue-ID: APPC-1086
Change-Id: Ie87a796113a818a2454f8f2e339563ac062ee627
Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
appc-config/appc-data-services/provider/src/test/java/org/onap/appc/data/services/node/ConfigResourceNodeTest.java

index e5c5149..776acda 100644 (file)
@@ -1,3 +1,26 @@
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Modification Copyright (C) 2018 IBM.
+ * =============================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ * ============LICENSE_END=========================================================
+ */
+
 package org.onap.appc.data.services.node;
 
 import static org.junit.Assert.assertEquals;
@@ -120,7 +143,16 @@ public class ConfigResourceNodeTest {
 
         ConfigResourceNode configResourceNode = new ConfigResourceNode(dbServiceMock);
         configResourceNode.getTemplate(inParams, contextMock);
-
+        verify(contextMock).setAttribute(anyString(), eq(AppcDataServiceConstant.OUTPUT_STATUS_SUCCESS));
+    }
+    
+    @Test
+    public void testGetVnfcReference() throws Exception {
+        DGGeneralDBService dbServiceMock = new MockDbServiceBuilder().build();
+        ConfigResourceNode configResourceNode = new ConfigResourceNode(dbServiceMock);
+        contextMock.setAttribute("template-model-id", "testModelId");
+        contextMock.setAttribute("vnfc-type", "testVnfcType");
+        configResourceNode.getVnfcReference(inParams, contextMock);
         verify(contextMock).setAttribute(anyString(), eq(AppcDataServiceConstant.OUTPUT_STATUS_SUCCESS));
     }