From: Sandeep J Date: Mon, 6 Aug 2018 11:37:16 +0000 (+0530) Subject: added test case to ConfigResourceNodeTest.java X-Git-Tag: 1.4.0~130 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=386ce982642ec9fe41a324fac41c57ed1c650dcc;p=appc.git added test case to ConfigResourceNodeTest.java to increase code coverage Issue-ID: APPC-1086 Change-Id: Ie87a796113a818a2454f8f2e339563ac062ee627 Signed-off-by: Sandeep J --- 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)); }