Migrate to UntypedAbstractActor
[controller.git] / opendaylight / md-sal / sal-remoterpc-connector / src / test / java / org / opendaylight / controller / remote / rpc / RpcRegistrarTest.java
index aecadc4eb114fbb4ecff478084f220076a97e071..48b825ad391108ec513797fb41c53099cc9072ea 100644 (file)
@@ -11,8 +11,8 @@ import akka.actor.ActorRef;
 import akka.actor.ActorSystem;
 import akka.actor.Address;
 import akka.actor.Props;
-import akka.testkit.JavaTestKit;
 import akka.testkit.TestActorRef;
+import akka.testkit.javadsl.TestKit;
 import com.google.common.collect.ImmutableMap;
 import java.util.Collections;
 import java.util.Map;
@@ -24,11 +24,11 @@ import org.mockito.InOrder;
 import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
-import org.opendaylight.controller.md.sal.dom.api.DOMRpcIdentifier;
-import org.opendaylight.controller.md.sal.dom.api.DOMRpcImplementationRegistration;
-import org.opendaylight.controller.md.sal.dom.api.DOMRpcProviderService;
 import org.opendaylight.controller.remote.rpc.registry.RpcRegistry.Messages.UpdateRemoteEndpoints;
 import org.opendaylight.controller.remote.rpc.registry.RpcRegistry.RemoteRpcEndpoint;
+import org.opendaylight.mdsal.dom.api.DOMRpcIdentifier;
+import org.opendaylight.mdsal.dom.api.DOMRpcImplementationRegistration;
+import org.opendaylight.mdsal.dom.api.DOMRpcProviderService;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 
@@ -48,11 +48,11 @@ public class RpcRegistrarTest {
     private RpcRegistrar rpcRegistrar;
 
     @Before
-    public void setUp() throws Exception {
+    public void setUp() {
         MockitoAnnotations.initMocks(this);
         system = ActorSystem.create("test");
 
-        final JavaTestKit testKit = new JavaTestKit(system);
+        final TestKit testKit = new TestKit(system);
         final RemoteRpcProviderConfig config = new RemoteRpcProviderConfig.Builder("system").build();
         final Props props = RpcRegistrar.props(config, service);
         testActorRef = new TestActorRef<>(system, props, testKit.getRef(), "actorRef");
@@ -63,7 +63,7 @@ public class RpcRegistrarTest {
         final DOMRpcIdentifier secondEndpointId = DOMRpcIdentifier.create(
                 SchemaPath.create(true, QName.create("second:identifier", "bar")));
 
-        final JavaTestKit senderKit = new JavaTestKit(system);
+        final TestKit senderKit = new TestKit(system);
         firstEndpoint = new RemoteRpcEndpoint(senderKit.getRef(), Collections.singletonList(firstEndpointId));
         secondEndpoint = new RemoteRpcEndpoint(senderKit.getRef(), Collections.singletonList(secondEndpointId));
 
@@ -77,8 +77,8 @@ public class RpcRegistrarTest {
     }
 
     @After
-    public void tearDown() throws Exception {
-        JavaTestKit.shutdownActorSystem(system, null, Boolean.TRUE);
+    public void tearDown() {
+        TestKit.shutdownActorSystem(system, true);
     }
 
     @Test
@@ -95,7 +95,7 @@ public class RpcRegistrarTest {
     }
 
     @Test
-    public void testHandleReceiveAddEndpoint() throws Exception {
+    public void testHandleReceiveAddEndpoint() {
         final Map<Address, Optional<RemoteRpcEndpoint>> endpoints = ImmutableMap.of(
                 endpointAddress, Optional.of(firstEndpoint));
         testActorRef.tell(new UpdateRemoteEndpoints(endpoints), ActorRef.noSender());
@@ -106,7 +106,7 @@ public class RpcRegistrarTest {
     }
 
     @Test
-    public void testHandleReceiveRemoveEndpoint() throws Exception {
+    public void testHandleReceiveRemoveEndpoint() {
         final Map<Address, Optional<RemoteRpcEndpoint>> endpoints = ImmutableMap.of(
                 endpointAddress, Optional.empty());
         testActorRef.tell(new UpdateRemoteEndpoints(endpoints), ActorRef.noSender());
@@ -114,7 +114,7 @@ public class RpcRegistrarTest {
     }
 
     @Test
-    public void testHandleReceiveUpdateEndpoint() throws Exception {
+    public void testHandleReceiveUpdateEndpoint() {
         final InOrder inOrder = Mockito.inOrder(service, oldReg, newReg);
 
         testActorRef.tell(new UpdateRemoteEndpoints(ImmutableMap.of(endpointAddress, Optional.of(firstEndpoint))),
@@ -136,4 +136,4 @@ public class RpcRegistrarTest {
 
         Mockito.verifyNoMoreInteractions(service, oldReg, newReg);
     }
-}
\ No newline at end of file
+}