From 386ce982642ec9fe41a324fac41c57ed1c650dcc Mon Sep 17 00:00:00 2001 From: Sandeep J Date: Mon, 6 Aug 2018 17:07:16 +0530 Subject: added test case to ConfigResourceNodeTest.java to increase code coverage Issue-ID: APPC-1086 Change-Id: Ie87a796113a818a2454f8f2e339563ac062ee627 Signed-off-by: Sandeep J --- .../data/services/node/ConfigResourceNodeTest.java | 34 +++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'appc-config/appc-data-services') 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)); } -- cgit 1.2.3-korg