summaryrefslogtreecommitdiffstats
path: root/plugins/grToolkit/provider/src/test
diff options
context:
space:
mode:
authorMichael DÜrre <michael.duerre@highstreet-technologies.com>2021-01-18 05:41:16 +0100
committerDan Timoney <dtimoney@att.com>2021-01-27 15:56:35 -0500
commitce4e5f9a00d2677495240ad367b9bfc4b74752d0 (patch)
tree71292f2ce0a2f8549f1583c712412f43757454f5 /plugins/grToolkit/provider/src/test
parent5de81966f5574ae83e85aa7d5aa8865ea5deef24 (diff)
migrate sli to alu-SR1
migrate ODL interfaces and fix code for changes in alu-SR1 Issue-ID: CCSDK-3089 Signed-off-by: Michael DÜrre <michael.duerre@highstreet-technologies.com> Change-Id: Iad824627c581c902b639a2f0246e3133d4e38c48
Diffstat (limited to 'plugins/grToolkit/provider/src/test')
-rw-r--r--plugins/grToolkit/provider/src/test/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProviderTest.java68
1 files changed, 32 insertions, 36 deletions
diff --git a/plugins/grToolkit/provider/src/test/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProviderTest.java b/plugins/grToolkit/provider/src/test/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProviderTest.java
index edd6d1b8d..6495c89cf 100644
--- a/plugins/grToolkit/provider/src/test/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProviderTest.java
+++ b/plugins/grToolkit/provider/src/test/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProviderTest.java
@@ -20,25 +20,42 @@
*/
package org.onap.ccsdk.sli.plugins.grtoolkit;
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.get;
+import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.when;
import com.github.tomakehurst.wiremock.junit.WireMockRule;
-
import com.google.common.util.concurrent.ListenableFuture;
-
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Properties;
+import java.util.concurrent.ExecutionException;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.contrib.java.lang.system.EnvironmentVariables;
-
import org.onap.ccsdk.sli.core.dblib.DBLibConnection;
import org.onap.ccsdk.sli.core.dblib.DbLibService;
import org.onap.ccsdk.sli.plugins.grtoolkit.data.ClusterActor;
-
import org.opendaylight.controller.cluster.access.concepts.MemberName;
import org.opendaylight.controller.cluster.datastore.DistributedDataStoreInterface;
import org.opendaylight.controller.cluster.datastore.utils.ActorUtils;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
-import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.NotificationPublishService;
+import org.opendaylight.mdsal.binding.api.RpcProviderService;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.plugins.gr.toolkit.rev180926.AdminHealthOutput;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.plugins.gr.toolkit.rev180926.ClusterHealthOutput;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.plugins.gr.toolkit.rev180926.DatabaseHealthOutput;
@@ -49,38 +66,15 @@ import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.plugins.gr.toolkit.rev180
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.plugins.gr.toolkit.rev180926.ResumeAkkaTrafficOutput;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.plugins.gr.toolkit.rev180926.SiteHealthOutput;
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.plugins.gr.toolkit.rev180926.SiteIdentifierOutput;
+import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.plugins.gr.toolkit.rev180926.resume.akka.traffic.input.NodeInfoBuilder;
import org.opendaylight.yangtools.yang.common.RpcResult;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Properties;
-import java.util.concurrent.ExecutionException;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
-import static com.github.tomakehurst.wiremock.client.WireMock.get;
-import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.when;
-
public class GrToolkitProviderTest {
GrToolkitProvider provider;
GrToolkitProvider providerSpy;
DataBroker dataBroker;
NotificationPublishService notificationProviderService;
- RpcProviderRegistry rpcProviderRegistry;
+ RpcProviderService rpcProviderRegistry;
DistributedDataStoreInterface configDatastore;
DbLibService dbLibService;
DBLibConnection connection;
@@ -96,7 +90,7 @@ public class GrToolkitProviderTest {
environmentVariables.set("SDNC_CONFIG_DIR","src/test/resources");
dataBroker = mock(DataBroker.class);
notificationProviderService = mock(NotificationPublishService.class);
- rpcProviderRegistry = mock(RpcProviderRegistry.class);
+ rpcProviderRegistry = mock(RpcProviderService.class);
configDatastore = mock(DistributedDataStoreInterface.class);
dbLibService = mock(DbLibService.class);
connection = mock(DBLibConnection.class);
@@ -266,11 +260,13 @@ public class GrToolkitProviderTest {
@Test
public void haltTrafficTest() {
HaltAkkaTrafficInputBuilder builder = new HaltAkkaTrafficInputBuilder();
- builder.setNodeInfo(new ArrayList<>());
+ builder.setNodeInfo(Arrays.asList(
+ new org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.plugins.gr.toolkit.rev180926.halt.akka.traffic.
+ input.NodeInfoBuilder().build()));
ListenableFuture<RpcResult<HaltAkkaTrafficOutput>> result = provider.haltAkkaTraffic(builder.build());
try {
assertEquals("200", result.get().getResult().getStatus());
- } catch(InterruptedException | ExecutionException e) {
+ } catch (InterruptedException | ExecutionException e) {
fail();
}
}
@@ -278,7 +274,7 @@ public class GrToolkitProviderTest {
@Test
public void resumeTrafficTest() {
ResumeAkkaTrafficInputBuilder builder = new ResumeAkkaTrafficInputBuilder();
- builder.setNodeInfo(new ArrayList<>());
+ builder.setNodeInfo(Arrays.asList(new NodeInfoBuilder().build()));
ListenableFuture<RpcResult<ResumeAkkaTrafficOutput>> result = provider.resumeAkkaTraffic(builder.build());
try {
assertEquals("200", result.get().getResult().getStatus());