summaryrefslogtreecommitdiffstats
path: root/appc-provider/appc-provider-bundle
diff options
context:
space:
mode:
authorSandeep J <sandeejh@in.ibm.com>2019-03-19 13:32:17 +0530
committerJoss Armstrong <joss.armstrong@ericsson.com>2019-03-19 17:30:38 +0000
commit9f4304d6085d3cc9a2a242cdbd6a33c10cc91097 (patch)
treeac4f948b9912ad643c1c704fc58a69063d60ce47 /appc-provider/appc-provider-bundle
parentd3f061bf257c5b431bac30308875e5bafeaef130 (diff)
added test cases to TestAppcProvider.java
to increase code coverage Issue-ID: APPC-1086 Change-Id: Iff273f586c3d6ac9fa3809ef605013f11d3d2178 Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
Diffstat (limited to 'appc-provider/appc-provider-bundle')
-rw-r--r--appc-provider/appc-provider-bundle/src/test/java/org/onap/appc/provider/TestAppcProvider.java23
1 files changed, 21 insertions, 2 deletions
diff --git a/appc-provider/appc-provider-bundle/src/test/java/org/onap/appc/provider/TestAppcProvider.java b/appc-provider/appc-provider-bundle/src/test/java/org/onap/appc/provider/TestAppcProvider.java
index 9affec075..4a013df61 100644
--- a/appc-provider/appc-provider-bundle/src/test/java/org/onap/appc/provider/TestAppcProvider.java
+++ b/appc-provider/appc-provider-bundle/src/test/java/org/onap/appc/provider/TestAppcProvider.java
@@ -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
@@ -21,11 +23,16 @@
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));
+ }
}