added test cases to TestAppcProvider.java 35/82635/3
authorSandeep J <sandeejh@in.ibm.com>
Tue, 19 Mar 2019 08:02:17 +0000 (13:32 +0530)
committerJoss Armstrong <joss.armstrong@ericsson.com>
Tue, 19 Mar 2019 17:30:38 +0000 (17:30 +0000)
to increase code coverage

Issue-ID: APPC-1086
Change-Id: Iff273f586c3d6ac9fa3809ef605013f11d3d2178
Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
appc-provider/appc-provider-bundle/src/test/java/org/onap/appc/provider/TestAppcProvider.java

index 9affec0..4a013df 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.provider;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.Matchers.anyObject;
 import static org.mockito.Mockito.when;
+
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
+
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mockito;
@@ -41,6 +48,7 @@ import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.RestartInpu
 import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.SnapshotInput;
 import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.VmstatuscheckInput;
 import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.opendaylight.yang.gen.v1.org.onap.appc.provider.rev160104.EvacuateInput;
 
 public class TestAppcProvider {
 
@@ -57,8 +65,8 @@ public class TestAppcProvider {
 
         topologyService = Mockito.mock(TopologyService.class);
         result = Mockito.mock(RpcResult.class);
-        appcProvider =
-                new AppcProvider(dataBroker2, notificationProviderService, rpcProviderRegistry, appcProviderClient);
+        appcProvider = new AppcProvider(dataBroker2, notificationProviderService, rpcProviderRegistry,
+                appcProviderClient);
     }
 
     @Test
@@ -121,4 +129,15 @@ public class TestAppcProvider {
         ExecutorService executor = (ExecutorService) Whitebox.getInternalState(appcProvider, "executor");
         assertTrue(executor.isShutdown());
     }
+
+    @Test
+    public void testGetClient() {
+        assertSame(appcProviderClient, appcProvider.getClient());
+    }
+
+    @Test
+    public void testEvacuate() {
+        EvacuateInput input = null;
+        assertNull(appcProvider.evacuate(input));
+    }
 }