summaryrefslogtreecommitdiffstats
path: root/sliapi
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2018-10-04 13:23:01 +0000
committerGerrit Code Review <gerrit@onap.org>2018-10-04 13:23:01 +0000
commit6e7496ab499841ee00119bb0910486b7b1ce0677 (patch)
treee7eac47479d386826c987821035574f590c58402 /sliapi
parent70da6f9bc017811a0286e16da012e5cb72f3b3af (diff)
parente679025082286f86e983d999084605326c540547 (diff)
Merge "added test case to TestSlipapiprovider"
Diffstat (limited to 'sliapi')
-rw-r--r--sliapi/provider/src/test/java/org/onap/ccsdk/sli/core/sliapi/TestSliapiProvider.java25
1 files changed, 15 insertions, 10 deletions
diff --git a/sliapi/provider/src/test/java/org/onap/ccsdk/sli/core/sliapi/TestSliapiProvider.java b/sliapi/provider/src/test/java/org/onap/ccsdk/sli/core/sliapi/TestSliapiProvider.java
index 38cbd40c9..287f2f206 100644
--- a/sliapi/provider/src/test/java/org/onap/ccsdk/sli/core/sliapi/TestSliapiProvider.java
+++ b/sliapi/provider/src/test/java/org/onap/ccsdk/sli/core/sliapi/TestSliapiProvider.java
@@ -4,8 +4,12 @@
package org.onap.ccsdk.sli.core.sliapi;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import static org.mockito.Mockito.*;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
import java.io.InputStream;
import java.net.URL;
import java.util.HashMap;
@@ -13,6 +17,8 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Properties;
+import java.util.concurrent.Future;
+
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -86,7 +92,6 @@ public class TestSliapiProvider {
}
};
-
/**
* @throws java.lang.Exception
*/
@@ -95,10 +100,10 @@ public class TestSliapiProvider {
DataBroker dataBroker = mock(DataBroker.class);
NotificationPublishService notifyService = mock(NotificationPublishService.class);
RpcProviderRegistry rpcRegistry = mock(RpcProviderRegistry.class);
- BindingAwareBroker.RpcRegistration<SLIAPIService> rpcRegistration = (BindingAwareBroker.RpcRegistration<SLIAPIService>) mock(BindingAwareBroker.RpcRegistration.class);
+ BindingAwareBroker.RpcRegistration<SLIAPIService> rpcRegistration = (BindingAwareBroker.RpcRegistration<SLIAPIService>) mock(
+ BindingAwareBroker.RpcRegistration.class);
when(rpcRegistry.addRpcImplementation(any(Class.class), any(SLIAPIService.class))).thenReturn(rpcRegistration);
-
// Load svclogic.properties and get a SvcLogicStore
InputStream propStr = TestSliapiProvider.class.getResourceAsStream("/svclogic.properties");
Properties svcprops = new Properties();
@@ -111,7 +116,7 @@ public class TestSliapiProvider {
// Load the DG for the healthcheck api
URL testCaseUrl = TestSliapiProvider.class.getClassLoader().getResource(HEALTHCHECK_DG);
if (testCaseUrl == null) {
- fail("Cannot find "+HEALTHCHECK_DG);
+ fail("Cannot find " + HEALTHCHECK_DG);
}
SvcLogicParser.load(testCaseUrl.getPath(), store);
SvcLogicParser.activate("sli", "healthcheck", "1.0.0", "sync", store);
@@ -138,7 +143,8 @@ public class TestSliapiProvider {
}
/**
- * Test method for {@link org.onap.ccsdk.sli.core.sliapi.sliapiProvider#executeGraph(org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphInput)}.
+ * Test method for
+ * {@link org.onap.ccsdk.sli.core.sliapi.sliapiProvider#executeGraph(org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.core.sliapi.rev161110.ExecuteGraphInput)}.
*/
@Test
public void testExecuteGraph() {
@@ -154,14 +160,13 @@ public class TestSliapiProvider {
pList.add(pBuilder.build());
inputBuilder.setSliParameter(pList);
-
-
-
provider.executeGraph(inputBuilder.build());
+ assertTrue(provider.vlbcheck() instanceof Future<?>);
}
/**
- * Test method for {@link org.onap.ccsdk.sli.core.sliapi.sliapiProvider#healthcheck()}.
+ * Test method for
+ * {@link org.onap.ccsdk.sli.core.sliapi.sliapiProvider#healthcheck()}.
*/
@Test
public void testHealthcheck() {