summaryrefslogtreecommitdiffstats
path: root/appc-config/appc-data-services/provider/src
diff options
context:
space:
mode:
authorSandeep J <sandeejh@in.ibm.com>2018-08-06 17:07:16 +0530
committerSandeep J <sandeejh@in.ibm.com>2018-08-06 17:07:29 +0530
commit386ce982642ec9fe41a324fac41c57ed1c650dcc (patch)
treed1a67e3421479a5e39b21740aa7958c5260ffb0e /appc-config/appc-data-services/provider/src
parent3a19b9518b8dd2f56f1b417de46b1abbe4023117 (diff)
added test case to ConfigResourceNodeTest.java
to increase code coverage Issue-ID: APPC-1086 Change-Id: Ie87a796113a818a2454f8f2e339563ac062ee627 Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
Diffstat (limited to 'appc-config/appc-data-services/provider/src')
-rw-r--r--appc-config/appc-data-services/provider/src/test/java/org/onap/appc/data/services/node/ConfigResourceNodeTest.java34
1 files changed, 33 insertions, 1 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 e5c5149f3..776acda64 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
@@ -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));
}