added test cases to ArtifactHandlerProviderTest 04/83304/3
authorSandeep J <sandeejh@in.ibm.com>
Tue, 26 Mar 2019 08:11:32 +0000 (13:41 +0530)
committerPatrick Brady <patrick.brady@att.com>
Tue, 26 Mar 2019 20:05:17 +0000 (20:05 +0000)
to increase code coverage

Issue-ID: APPC-1086
Change-Id: Ic03b32bc4c8b87a76db2e2aae45f7706f19e9bd4
Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
appc-inbound/appc-artifact-handler/provider/src/test/java/org/onap/appc/artifact/handler/ArtifactHandlerProviderTest.java

index aa1c86a..9b6af87 100644 (file)
@@ -4,6 +4,8 @@
  * ================================================================================
  * Copyright (C) 2019 Ericsson
  * ================================================================================
+ * Modifications Copyright (C) 2019 IBM.
+ * ================================================================================
  * 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
 
 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;
@@ -37,14 +38,15 @@ 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;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+import com.google.common.util.concurrent.CheckedFuture;
 
 public class ArtifactHandlerProviderTest {
 
@@ -149,5 +151,20 @@ public class ArtifactHandlerProviderTest {
         Future<RpcResult<UploadartifactOutput>> output = (Future<RpcResult<UploadartifactOutput>>) artifactHandlerProvider.uploadartifact(uploadArtifactInput);
         assertTrue(output.get().getResult() instanceof UploadartifactOutput);
     }
+    
+    @Test
+    public void testClose() throws Exception
+    {
+        artifactHandlerProvider = new ArtifactHandlerProvider(dataBroker, notificationService, rpcRegistry);
+        artifactHandlerProvider.close();
+    }
+    
+    @Test
+    public void testGetArtifactHandlerProviderUtil() throws Exception
+    {
+        artifactHandlerProvider = new ArtifactHandlerProvider(dataBroker, notificationService, rpcRegistry);
+        UploadartifactInput uploadArtifactInput = Mockito.mock(UploadartifactInput.class);
+        assertTrue(artifactHandlerProvider.getArtifactHandlerProviderUtil(uploadArtifactInput) instanceof ArtifactHandlerProviderUtil);
+    }
 
 }