diff options
author | Sandeep J <sandeejh@in.ibm.com> | 2019-01-16 21:16:49 +0530 |
---|---|---|
committer | Takamune Cho <takamune.cho@att.com> | 2019-01-16 19:08:55 +0000 |
commit | 5e9312948808342be8f631df95e26d7462806542 (patch) | |
tree | 570363c66ae3b0b8e8e322403ecb0fb0363891ab | |
parent | 4d15a7a87d5d2d5f7028a087d6f0df449010cb99 (diff) |
added test case to ConfigResourceNode.java
to increase code coverage
Issue-ID: APPC-1086
Change-Id: I3d49e11a910b42a9e0ec17768a79c43dfc018c34
Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
-rw-r--r-- | appc-config/appc-data-services/provider/src/test/java/org/onap/appc/data/services/node/ConfigResourceNodeTest.java | 20 |
1 files changed, 19 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 5707aaa8d..fd3448ed5 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. * ================================================================================ - * Modifications Copyright (C) 2018 IBM. + * Modifications Copyright (C) 2018-2019 IBM. * ============================================================================= * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -716,4 +716,22 @@ public class ConfigResourceNodeTest { verify(contextMock, atLeastOnce()).setAttribute(anyString(), eq(AppcDataServiceConstant.OUTPUT_STATUS_SUCCESS)); } + + @Test + public void testSaveStyleSheetConfig() throws SvcLogicException + { + SvcLogicContext context = new SvcLogicContext(); + inParams.put(AppcDataServiceConstant.INPUT_PARAM_RESPONSE_PREFIX, "test"); + context.setAttribute("tmp.merge.mergedData", "test"); + context.setAttribute("tmp.convertconfig.escapeData", "test"); + context.setAttribute("tmp.merge.mergedData", "test"); + DGGeneralDBService dbServiceMock = + new MockDbServiceBuilder().savePrepareRelationship(PREPARE_RELATIONSHIP_PARAM, "some file id", SDC_IND, + SvcLogicResource.QueryStatus.FAILURE).build(); + + ConfigResourceNode configResourceNode = new ConfigResourceNode(dbServiceMock); + configResourceNode.saveStyleSheetConfig(inParams, contextMock); + + verify(contextMock, atLeastOnce()).setAttribute(anyString(), eq(AppcDataServiceConstant.OUTPUT_STATUS_SUCCESS)); + } } |