From e38c122ec2c57e63d0788148841fbe6231957482 Mon Sep 17 00:00:00 2001 From: Sandeep J Date: Wed, 6 Feb 2019 15:20:00 +0530 Subject: added test case to ConfigResourceNodeTest to increase code coverage Issue-ID: APPC-1086 Change-Id: I69a92c10c3c2543a45ebf333e708286ffb6ac454 Signed-off-by: Sandeep J --- .../data/services/node/ConfigResourceNodeTest.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'appc-config') 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 fd3448ed5..5ecdbc49c 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 @@ -25,6 +25,7 @@ package org.onap.appc.data.services.node; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; import static org.mockito.Matchers.anyString; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.atLeastOnce; @@ -734,4 +735,24 @@ public class ConfigResourceNodeTest { verify(contextMock, atLeastOnce()).setAttribute(anyString(), eq(AppcDataServiceConstant.OUTPUT_STATUS_SUCCESS)); } + + @Test + public void testSaveConfigTransactionLog() throws SvcLogicException + { + SvcLogicContext context = new SvcLogicContext(); + inParams.put(AppcDataServiceConstant.INPUT_PARAM_RESPONSE_PREFIX, "test"); + inParams.put(AppcDataServiceConstant.INPUT_PARAM_MESSAGE_TYPE, "test"); + inParams.put(AppcDataServiceConstant.INPUT_PARAM_MESSAGE, "test"); + + context.setAttribute("request-id", "test"); + DGGeneralDBService dbServiceMock = + new MockDbServiceBuilder().savePrepareRelationship(PREPARE_RELATIONSHIP_PARAM, "some file id", SDC_IND, + SvcLogicResource.QueryStatus.FAILURE).build(); + + ConfigResourceNode configResourceNode = new ConfigResourceNode(dbServiceMock); + configResourceNode.saveConfigTransactionLog(inParams, contextMock); + assertEquals(null,contextMock.getAttribute("log-message")); + } + + } -- cgit 1.2.3-korg