From 52b8066a392b0c3bee7fa9339930126ff684eafa Mon Sep 17 00:00:00 2001 From: Sandeep J Date: Mon, 10 Sep 2018 02:45:59 +0530 Subject: added test case to ConfigResourceNodeTest to increase code coverage Issue-ID: APPC-1086 Change-Id: I1e8948ed3009704bf4f118b2ac6a6b94aa96178c Signed-off-by: Sandeep J --- .../appc/data/services/node/ConfigResourceNodeTest.java | 17 ++++++++++++++++- 1 file changed, 16 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 bdb2b7cc4..5707aaa8d 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 @@ -4,7 +4,7 @@ * ================================================================================ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ - * Modification Copyright (C) 2018 IBM. + * Modifications 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. @@ -700,5 +700,20 @@ public class ConfigResourceNodeTest { verify(configResourceNode).saveConfigBlock(inParams, contextMock); verify(contextMock, atLeastOnce()).setAttribute(anyString(), eq(AppcDataServiceConstant.OUTPUT_STATUS_SUCCESS)); } + + @Test + public void testSaveTemplateConfig() throws SvcLogicException + { + SvcLogicContext context = new SvcLogicContext(); + context.setAttribute(CONFIG_FILE_ID_PARAM, "some file id"); + + DGGeneralDBService dbServiceMock = + new MockDbServiceBuilder().savePrepareRelationship(PREPARE_RELATIONSHIP_PARAM, "some file id", SDC_IND, + SvcLogicResource.QueryStatus.FAILURE).build(); + + ConfigResourceNode configResourceNode = new ConfigResourceNode(dbServiceMock); + configResourceNode.saveTemplateConfig(inParams, contextMock); + verify(contextMock, atLeastOnce()).setAttribute(anyString(), eq(AppcDataServiceConstant.OUTPUT_STATUS_SUCCESS)); + } } -- cgit