summaryrefslogtreecommitdiffstats
path: root/appc-config/appc-data-services
diff options
context:
space:
mode:
authorSandeep J <sandeejh@in.ibm.com>2018-09-10 02:45:59 +0530
committerTakamune Cho <tc012c@att.com>2018-09-10 16:59:42 +0000
commit52b8066a392b0c3bee7fa9339930126ff684eafa (patch)
tree86dfd7c01ee232ff3b5dd9cdce4088d79adfb6ae /appc-config/appc-data-services
parent237e4d0ffa907fefd203f1e34cba840f4d8eba08 (diff)
added test case to ConfigResourceNodeTest
to increase code coverage Issue-ID: APPC-1086 Change-Id: I1e8948ed3009704bf4f118b2ac6a6b94aa96178c Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
Diffstat (limited to 'appc-config/appc-data-services')
-rw-r--r--appc-config/appc-data-services/provider/src/test/java/org/onap/appc/data/services/node/ConfigResourceNodeTest.java17
1 files changed, 16 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 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));
+ }
}