Coverage for appc-artifact-handler package 92/76092/2
authorJoss Armstrong <joss.armstrong@ericsson.com>
Mon, 21 Jan 2019 20:29:19 +0000 (20:29 +0000)
committerTakamune Cho <takamune.cho@att.com>
Tue, 22 Jan 2019 15:07:14 +0000 (15:07 +0000)
Increased coverage from 0% to 95%

Issue-ID: APPC-1335
Change-Id: I3c2e1f22009c47cda983e61eda7e98c48564ee98
Signed-off-by: Joss Armstrong <joss.armstrong@ericsson.com>
appc-inbound/appc-artifact-handler/provider/src/main/java/org/onap/appc/artifact/handler/ArtifactHandlerProvider.java
appc-inbound/appc-artifact-handler/provider/src/main/java/org/onap/appc/artifact/handler/SdcArtifactHandlerActivator.java
appc-inbound/appc-artifact-handler/provider/src/test/java/org/onap/appc/artifact/handler/ArtifactHandlerProviderTest.java [new file with mode: 0644]
appc-inbound/appc-artifact-handler/provider/src/test/java/org/onap/appc/artifact/handler/SdcArtifactHandlerActivatorTest.java [new file with mode: 0644]
appc-inbound/appc-artifact-handler/provider/src/test/java/org/onap/appc/artifact/handler/dbservices/TestDBServiceExceptions.java

index 5bfdf96..9ca1f44 100644 (file)
@@ -5,6 +5,8 @@
  * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Copyright (C) 2017 Amdocs
+ * ================================================================================
+ * Modifications Copyright (C) 2019 Ericsson
  * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -145,19 +147,19 @@ public class ArtifactHandlerProvider implements AutoCloseable, ArtifactHandlerSe
             String finalInd) {
 
         UploadartifactOutputBuilder responseBuilder = new UploadartifactOutputBuilder();
-        ConfigDocumentResponseBuilder configResponseBuilder=new ConfigDocumentResponseBuilder();            
-        configResponseBuilder.setRequestId(svcRequestId);            
-        configResponseBuilder.setStatus(code);            
-        configResponseBuilder.setErrorReason(message);            
+        ConfigDocumentResponseBuilder configResponseBuilder=new ConfigDocumentResponseBuilder();
+        configResponseBuilder.setRequestId(svcRequestId);
+        configResponseBuilder.setStatus(code);
+        configResponseBuilder.setErrorReason(message);
         RpcResult<UploadartifactOutput> rpcResult = RpcResultBuilder.<UploadartifactOutput> status(true)
                 .withResult(responseBuilder.build()).build();
-        return rpcResult;            
+        return rpcResult;
     }
 
     @Override
     public Future<RpcResult<UploadartifactOutput>> uploadartifact(UploadartifactInput input) {
 
-        if (input == null || input.getDocumentParameters() == null || input.getDocumentParameters().getArtifactContents() == null ) {        
+        if (input == null || input.getDocumentParameters() == null || input.getDocumentParameters().getArtifactContents() == null ) {
             RpcResult<UploadartifactOutput> rpcResult =
                     buildResponse1("N/A", "N/A", "INVALID_INPUT", "Invalid input, null or empty document information" , "Y");
             return Futures.immediateFuture(rpcResult);
@@ -166,10 +168,9 @@ public class ArtifactHandlerProvider implements AutoCloseable, ArtifactHandlerSe
         ConfigDocumentResponseBuilder configResponseBuilder = new ConfigDocumentResponseBuilder();
         UploadartifactOutputBuilder responseBuilder = new UploadartifactOutputBuilder();
         log.info("Received input = " + input );
-        ArtifactHandlerProviderUtil designUtil = new ArtifactHandlerProviderUtil(input);
+        ArtifactHandlerProviderUtil designUtil = getArtifactHandlerProviderUtil(input);
         configResponseBuilder.setRequestId(input.getRequestInformation().getRequestId());
         try{
-            
             if(input.getRequestInformation().getSource() !=null){
                 if(input.getRequestInformation().getSource().equalsIgnoreCase(SdcArtifactHandlerConstants.DESIGN_TOOL)){
                         designUtil.processTemplate(designUtil.createDummyRequestData());
@@ -178,27 +179,29 @@ public class ArtifactHandlerProvider implements AutoCloseable, ArtifactHandlerSe
                 else
                 {
                     designUtil.processTemplate(designUtil.createRequestData());
-                    configResponseBuilder.setStatus(ArtifactHandlerProviderUtil.DistributionStatusEnum.DEPLOY_OK.toString());        
+                    configResponseBuilder.setStatus(ArtifactHandlerProviderUtil.DistributionStatusEnum.DEPLOY_OK.toString());
                 }
             }
             else
             {
-                throw new Exception("No Tempalte data found");                
+                throw new Exception("No Template data found");
             }
-            
-            
         }
         catch (Exception e) {
 
-            configResponseBuilder.setErrorReason(e.getMessage());            
+            configResponseBuilder.setErrorReason(e.getMessage());
             configResponseBuilder.setStatus(ArtifactHandlerProviderUtil.DistributionStatusEnum.DEPLOY_ERROR.toString());
             log.error("Caught exception looking for Artifact Handler", e);
             log.info("Caught exception looking for Artifact Handler: ");
         }
-        
+
         responseBuilder.setConfigDocumentResponse(configResponseBuilder.build());
         RpcResult<UploadartifactOutput> rpcResult = RpcResultBuilder.<UploadartifactOutput> status(true).withResult(responseBuilder.build()).build();
         return Futures.immediateFuture(rpcResult);
 
     }
+
+    protected ArtifactHandlerProviderUtil getArtifactHandlerProviderUtil(UploadartifactInput input) {
+        return new ArtifactHandlerProviderUtil(input);
+    }
 }
index 5a62f7b..58f4a12 100644 (file)
@@ -5,6 +5,8 @@
  * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Copyright (C) 2017 Amdocs
+ * ================================================================================
+ * Modifications Copyright (C) 2019 Ericsson
  * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -38,7 +40,7 @@ public class SdcArtifactHandlerActivator implements BundleActivator {
 
     private static final EELFLogger log = EELFManager.getInstance().getLogger(SdcArtifactHandlerActivator.class);
     private List<ServiceRegistration> registrations = new LinkedList<ServiceRegistration>();
-    
+
     @Override
     public void start(BundleContext ctx) throws Exception {
         ArtifactHandlerNode artifactHandlerNode = new ArtifactHandlerNode();
diff --git a/appc-inbound/appc-artifact-handler/provider/src/test/java/org/onap/appc/artifact/handler/ArtifactHandlerProviderTest.java b/appc-inbound/appc-artifact-handler/provider/src/test/java/org/onap/appc/artifact/handler/ArtifactHandlerProviderTest.java
new file mode 100644 (file)
index 0000000..56a9991
--- /dev/null
@@ -0,0 +1,160 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2019 Ericsson
+ * ================================================================================
+ * 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.artifact.handler;
+
+import com.google.common.util.concurrent.CheckedFuture;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.onap.appc.artifact.handler.utils.ArtifactHandlerProviderUtil;
+import org.onap.appc.artifact.handler.utils.SdcArtifactHandlerConstants;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
+import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
+import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.opendaylight.yang.gen.v1.org.onap.appc.artifacthandler.rev170321.ArtifactHandlerService;
+import org.opendaylight.yang.gen.v1.org.onap.appc.artifacthandler.rev170321.UploadartifactInput;
+import org.opendaylight.yang.gen.v1.org.onap.appc.artifacthandler.rev170321.UploadartifactInputBuilder;
+import org.opendaylight.yang.gen.v1.org.onap.appc.artifacthandler.rev170321.UploadartifactOutput;
+import org.opendaylight.yang.gen.v1.org.onap.appc.artifacthandler.rev170321.document.parameters.DocumentParameters;
+import org.opendaylight.yang.gen.v1.org.onap.appc.artifacthandler.rev170321.request.information.RequestInformation;
+import org.powermock.reflect.Whitebox;
+
+public class ArtifactHandlerProviderTest {
+
+    private DataBroker dataBroker = Mockito.mock(DataBroker.class);
+    private RpcProviderRegistry rpcRegistry = Mockito.mock(RpcProviderRegistry.class);
+    private NotificationPublishService notificationService = Mockito.mock(NotificationPublishService.class);
+    private ReadWriteTransaction writeTransaction = Mockito.mock(ReadWriteTransaction.class);
+    private CheckedFuture checkedFuture = Mockito.mock(CheckedFuture.class);
+    private BindingAwareBroker.RpcRegistration<ArtifactHandlerService> rpcRegistration;
+
+    private ArtifactHandlerProvider artifactHandlerProvider;
+
+    @Before
+    public void setup() {
+        rpcRegistration =
+                (BindingAwareBroker.RpcRegistration<ArtifactHandlerService>) Mockito.mock(BindingAwareBroker.RpcRegistration.class);
+        Mockito.doReturn(writeTransaction).when(dataBroker).newReadWriteTransaction();
+        Mockito.doReturn(checkedFuture).when(writeTransaction).submit();
+    }
+
+    @Test
+    public void testClose() throws Exception {
+        artifactHandlerProvider = new ArtifactHandlerProvider(dataBroker, notificationService, rpcRegistry);
+        Whitebox.setInternalState(artifactHandlerProvider, "rpcRegistration", rpcRegistration);
+        artifactHandlerProvider.close();
+        Mockito.verify(rpcRegistration).close();
+    }
+
+    @Test
+    public void testUploadArtifactNullInput() throws InterruptedException, ExecutionException {
+        artifactHandlerProvider = new ArtifactHandlerProvider(dataBroker, notificationService, rpcRegistry);
+        UploadartifactInput uploadArtifactInput = Mockito.mock(UploadartifactInput.class);
+        Future<RpcResult<UploadartifactOutput>> output = (Future<RpcResult<UploadartifactOutput>>) artifactHandlerProvider.uploadartifact(uploadArtifactInput);
+        assertTrue(output.get().getResult() instanceof UploadartifactOutput);
+    }
+
+    @Test
+    public void testUploadArtifactException() throws Exception {
+        artifactHandlerProvider = Mockito.spy(new ArtifactHandlerProvider(dataBroker, notificationService, rpcRegistry));
+        UploadartifactInputBuilder builder = new UploadartifactInputBuilder();
+        DocumentParameters mockDocumentParameters = Mockito.mock(DocumentParameters.class);
+        Mockito.doReturn("ARTIFACT CONTENTS").when(mockDocumentParameters).getArtifactContents();
+        Mockito.doReturn("ARTIFACT NAME").when(mockDocumentParameters).getArtifactName();
+        builder.setDocumentParameters(mockDocumentParameters);
+        RequestInformation mockRequestInformation = Mockito.mock(RequestInformation.class);
+        Mockito.doReturn("REQUEST ID").when(mockRequestInformation).getRequestId();
+        Mockito.doReturn(SdcArtifactHandlerConstants.DESIGN_TOOL).when(mockRequestInformation).getSource();
+        builder.setRequestInformation(mockRequestInformation);
+        UploadartifactInput uploadArtifactInput = builder.build();
+        ArtifactHandlerProviderUtil mockProvider = Mockito.mock(ArtifactHandlerProviderUtil.class);
+        Mockito.doThrow(new Exception()).when(mockProvider).processTemplate(Mockito.anyString());
+        Mockito.doReturn(mockProvider).when(artifactHandlerProvider).getArtifactHandlerProviderUtil(Mockito.any(UploadartifactInput.class));
+        Future<RpcResult<UploadartifactOutput>> output = (Future<RpcResult<UploadartifactOutput>>) artifactHandlerProvider.uploadartifact(uploadArtifactInput);
+        assertTrue(output.get().getResult() instanceof UploadartifactOutput);
+    }
+
+    @Test
+    public void testUploadArtifact() throws InterruptedException, ExecutionException {
+        artifactHandlerProvider = Mockito.spy(new ArtifactHandlerProvider(dataBroker, notificationService, rpcRegistry));
+        UploadartifactInputBuilder builder = new UploadartifactInputBuilder();
+        DocumentParameters mockDocumentParameters = Mockito.mock(DocumentParameters.class);
+        Mockito.doReturn("ARTIFACT CONTENTS").when(mockDocumentParameters).getArtifactContents();
+        Mockito.doReturn("ARTIFACT NAME").when(mockDocumentParameters).getArtifactName();
+        builder.setDocumentParameters(mockDocumentParameters);
+        RequestInformation mockRequestInformation = Mockito.mock(RequestInformation.class);
+        Mockito.doReturn("REQUEST ID").when(mockRequestInformation).getRequestId();
+        Mockito.doReturn(SdcArtifactHandlerConstants.DESIGN_TOOL).when(mockRequestInformation).getSource();
+        builder.setRequestInformation(mockRequestInformation);
+        UploadartifactInput uploadArtifactInput = builder.build();
+        ArtifactHandlerProviderUtil mockProvider = Mockito.mock(ArtifactHandlerProviderUtil.class);
+        Mockito.doReturn(mockProvider).when(artifactHandlerProvider).getArtifactHandlerProviderUtil(Mockito.any(UploadartifactInput.class));
+        Future<RpcResult<UploadartifactOutput>> output = (Future<RpcResult<UploadartifactOutput>>) artifactHandlerProvider.uploadartifact(uploadArtifactInput);
+        assertTrue(output.get().getResult() instanceof UploadartifactOutput);
+    }
+
+    @Test
+    public void testUploadArtifact2() throws InterruptedException, ExecutionException {
+        artifactHandlerProvider = Mockito.spy(new ArtifactHandlerProvider(dataBroker, notificationService, rpcRegistry));
+        UploadartifactInputBuilder builder = new UploadartifactInputBuilder();
+        DocumentParameters mockDocumentParameters = Mockito.mock(DocumentParameters.class);
+        Mockito.doReturn("ARTIFACT CONTENTS").when(mockDocumentParameters).getArtifactContents();
+        Mockito.doReturn("ARTIFACT NAME").when(mockDocumentParameters).getArtifactName();
+        builder.setDocumentParameters(mockDocumentParameters);
+        RequestInformation mockRequestInformation = Mockito.mock(RequestInformation.class);
+        Mockito.doReturn("REQUEST ID").when(mockRequestInformation).getRequestId();
+        builder.setRequestInformation(mockRequestInformation);
+        UploadartifactInput uploadArtifactInput = builder.build();
+        ArtifactHandlerProviderUtil mockProvider = Mockito.mock(ArtifactHandlerProviderUtil.class);
+        Mockito.doReturn(mockProvider).when(artifactHandlerProvider).getArtifactHandlerProviderUtil(Mockito.any(UploadartifactInput.class));
+        Future<RpcResult<UploadartifactOutput>> output = (Future<RpcResult<UploadartifactOutput>>) artifactHandlerProvider.uploadartifact(uploadArtifactInput);
+        assertTrue(output.get().getResult() instanceof UploadartifactOutput);
+    }
+
+    @Test
+    public void testUploadArtifact3() throws InterruptedException, ExecutionException {
+        artifactHandlerProvider = Mockito.spy(new ArtifactHandlerProvider(dataBroker, notificationService, rpcRegistry));
+        UploadartifactInputBuilder builder = new UploadartifactInputBuilder();
+        DocumentParameters mockDocumentParameters = Mockito.mock(DocumentParameters.class);
+        Mockito.doReturn("ARTIFACT CONTENTS").when(mockDocumentParameters).getArtifactContents();
+        Mockito.doReturn("ARTIFACT NAME").when(mockDocumentParameters).getArtifactName();
+        builder.setDocumentParameters(mockDocumentParameters);
+        RequestInformation mockRequestInformation = Mockito.mock(RequestInformation.class);
+        Mockito.doReturn("REQUEST ID").when(mockRequestInformation).getRequestId();
+        Mockito.doReturn(SdcArtifactHandlerConstants.ACTION).when(mockRequestInformation).getSource();
+        builder.setRequestInformation(mockRequestInformation);
+        UploadartifactInput uploadArtifactInput = builder.build();
+        ArtifactHandlerProviderUtil mockProvider = Mockito.mock(ArtifactHandlerProviderUtil.class);
+        Mockito.doReturn(mockProvider).when(artifactHandlerProvider).getArtifactHandlerProviderUtil(Mockito.any(UploadartifactInput.class));
+        Future<RpcResult<UploadartifactOutput>> output = (Future<RpcResult<UploadartifactOutput>>) artifactHandlerProvider.uploadartifact(uploadArtifactInput);
+        assertTrue(output.get().getResult() instanceof UploadartifactOutput);
+    }
+
+}
diff --git a/appc-inbound/appc-artifact-handler/provider/src/test/java/org/onap/appc/artifact/handler/SdcArtifactHandlerActivatorTest.java b/appc-inbound/appc-artifact-handler/provider/src/test/java/org/onap/appc/artifact/handler/SdcArtifactHandlerActivatorTest.java
new file mode 100644 (file)
index 0000000..995ffec
--- /dev/null
@@ -0,0 +1,55 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2019 Ericsson
+ * ================================================================================
+ * 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.artifact.handler;
+
+import java.util.LinkedList;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+import org.powermock.reflect.Whitebox;
+
+
+public class SdcArtifactHandlerActivatorTest {
+
+    @Test
+    public void testStart() throws Exception {
+        SdcArtifactHandlerActivator activator = new SdcArtifactHandlerActivator();
+        BundleContext ctx = Mockito.mock(BundleContext.class);
+        LinkedList<ServiceRegistration> list = Mockito.spy(new LinkedList<>());
+        Whitebox.setInternalState(activator, "registrations", list);
+        activator.start(ctx);
+        Mockito.verify(list).add(Mockito.any());
+    }
+
+    @Test
+    public void testStop() throws Exception {
+        SdcArtifactHandlerActivator activator = new SdcArtifactHandlerActivator();
+        BundleContext ctx = Mockito.mock(BundleContext.class);
+        LinkedList<ServiceRegistration> list = Mockito.spy(new LinkedList<>());
+        ServiceRegistration serviceRegistration = Mockito.mock(ServiceRegistration.class);
+        list.add(serviceRegistration);
+        Whitebox.setInternalState(activator, "registrations", list);
+        activator.stop(ctx);
+        Mockito.verify(serviceRegistration).unregister();
+    }
+}
index 3c42985..8067439 100644 (file)
@@ -3,6 +3,8 @@
  * ONAP : APPC
  * ================================================================================
  * Copyright (C) 2018 IBM
+ * ================================================================================
+ * Modifications Copyright (C) 2019 Ericsson
  * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -49,103 +51,102 @@ public class TestDBServiceExceptions {
         }
 
     @Test
-    public void testSaveArtifacts() throws Exception {              
+    public void testSaveArtifacts() throws Exception {
         String artifactName = "TestArtifact";
-        String prefix ="";
+        String prefix = "";
         ctx.setAttribute("test", "test");
-        String result= dbService.getInternalVersionNumber(ctx, artifactName, prefix);
-        assertEquals("1",result);
-       
+        String result = dbService.getInternalVersionNumber(ctx, artifactName, prefix);
+        assertEquals("1", result);
     }
 
     @Test
-    public void testProcessSdcReferencesForCapability() throws Exception {        
+    public void testProcessSdcReferencesForCapability() throws Exception {
         ctx.setAttribute("test", "test");
         ctx.setAttribute(SdcArtifactHandlerConstants.FILE_CATEGORY, "capability");
         boolean isUpdate = false;
         String expectedKey = "insert into ASDC_REFERENCE set VNFC_TYPE = null  , FILE_CATEGORY = $file-category , " +
                 "VNF_TYPE = $vnf-type , ACTION = null  , ARTIFACT_TYPE = null  , ARTIFACT_NAME = $artifact-name";
         dbService.processSdcReferences(ctx, isUpdate);
-        assertEquals(expectedKey,ctx.getAttribute("keys"));
+        assertEquals(expectedKey, ctx.getAttribute("keys"));
         }
 
     @Test
-    public void testProcessSdcReferences() throws Exception {        
+    public void testProcessSdcReferences() throws Exception {
         ctx.setAttribute("test", "test");
         ctx.setAttribute(SdcArtifactHandlerConstants.FILE_CATEGORY, "Test");
         String expectedKey = "insert into ASDC_REFERENCE set VNFC_TYPE = $vnfc-type , FILE_CATEGORY = $file-category , VNF_TYPE = $vnf-type , ACTION = $action , ARTIFACT_TYPE = $artifact-type , ARTIFACT_NAME = $artifact-name";
         boolean isUpdate = false;
         dbService.processSdcReferences(ctx, isUpdate);
-        assertEquals(expectedKey,ctx.getAttribute("keys"));
+        assertEquals(expectedKey, ctx.getAttribute("keys"));
     }
 
     @Test(expected = Exception.class)
-    public void testGetDownLoadDGReference() throws Exception {       
+    public void testGetDownLoadDGReference() throws Exception {
         ctx.setAttribute("test", "test");
         ctx.setAttribute(SdcArtifactHandlerConstants.DEVICE_PROTOCOL, "");
         dbService.getDownLoadDGReference(ctx);
     }
 
     @Test
-    public void testProcessConfigActionDg() throws Exception {      
+    public void testProcessConfigActionDg() throws Exception {
         ctx.setAttribute("test", "test");
         boolean isUpdate = false;
         ctx.setAttribute(SdcArtifactHandlerConstants.DOWNLOAD_DG_REFERENCE, "Reference");
         String expectedKey = "insert into CONFIGURE_ACTION_DG set DOWNLOAD_CONFIG_DG = $download-dg-reference , ACTION = $action , VNF_TYPE = $vnf-type";
         dbService.processConfigActionDg(ctx, isUpdate);
-        assertEquals(expectedKey,ctx.getAttribute("keys"));
+        assertEquals(expectedKey, ctx.getAttribute("keys"));
     }
 
     @Test
-    public void testProcessConfigActionDgForElse() throws Exception {       
+    public void testProcessConfigActionDgForElse() throws Exception {
         ctx.setAttribute("test", "test");
         boolean isUpdate = false;
         String expectedKey = null;
         dbService.processConfigActionDg(ctx, isUpdate);
-        assertEquals(expectedKey,ctx.getAttribute("keys"));
+        assertEquals(expectedKey, ctx.getAttribute("keys"));
     }
 
     @Test
-    public void testprocessDpwnloadDGReference() throws Exception {        
+    public void testprocessDpwnloadDGReference() throws Exception {
         ctx.setAttribute("test", "test");
         boolean isUpdate = false;
         String expectedKey = "insert into DOWNLOAD_DG_REFERENCE set DOWNLOAD_CONFIG_DG = $download-dg-reference , PROTOCOL = $device-protocol";
         dbService.processDownloadDgReference(ctx, isUpdate);
-        assertEquals(expectedKey,ctx.getAttribute("keys"));
+        assertEquals(expectedKey, ctx.getAttribute("keys"));
     }
 
     @Test
-    public void testResolveWhereClause() throws Exception {       
+    public void testResolveWhereClause() throws Exception {
         ctx.setAttribute("test", "test");
         String db="DOWNLOAD_DG_REFERENCE";
-        String whereClause="";
+        String whereClause = "";
         String result =  Whitebox.invokeMethod(dbService, "resolveWhereClause", ctx, db, whereClause);
         assertEquals(true, result.contains("PROTOCOL"));
     }
 
     @Test
-    public void testResolveWhereClauseForDevice_Authentication() throws Exception {       
+    public void testResolveWhereClauseForDevice_Authentication() throws Exception {
         ctx.setAttribute("test", "test");
         String db="DEVICE_AUTHENTICATION";
-        String whereClause="Test";
+        String whereClause = "Test";
         String result =  Whitebox.invokeMethod(dbService, "resolveWhereClause", ctx, db, whereClause);
         assertEquals(true, result.contains("Test"));
     }
 
     @Test
-    public void testResolveWhereClauseCONFIGURE_ACTION_DG() throws Exception {        
+    public void testResolveWhereClauseCONFIGURE_ACTION_DG() throws Exception {
         ctx.setAttribute("test", "test");
-        String db="CONFIGURE_ACTION_DG";
-        String whereClause="Test";
+        String db = "CONFIGURE_ACTION_DG";
+        String whereClause = "Test";
         String result =  Whitebox.invokeMethod(dbService, "resolveWhereClause", ctx, db, whereClause);
         assertEquals(true, result.contains("Test"));
     }
 
     @Test
-    public void testResolveWhereClauseVNFC_REFERENCE() throws Exception {      
+    public void testResolveWhereClauseVNFC_REFERENCE() throws Exception {
         ctx.setAttribute("test", "test");
-        String db="VNFC_REFERENCE";
-        String whereClause="TestVNFC_REFERENCE";
+        String db = "VNFC_REFERENCE";
+        String whereClause = "TestVNFC_REFERENCE";
         String result =  Whitebox.invokeMethod(dbService, "resolveWhereClause", ctx, db, whereClause);
         assertEquals(true, result.contains("TestVNFC_REFERENCE"));
     }