Migrate from JavaTestKit to javadsl.TestKit
[controller.git] / opendaylight / md-sal / sal-remoterpc-connector / src / test / java / org / opendaylight / controller / remote / rpc / RpcBrokerTest.java
index a553ab9ac3ebc3edcff30e89623a80ad4963a1a3..d588736f61b0f0aa2e5436abccd23f3e5da3968e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ * Copyright (c) 2014, 2017 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -8,13 +8,12 @@
 
 package org.opendaylight.controller.remote.rpc;
 
-
 import static org.junit.Assert.assertEquals;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.when;
 
 import akka.actor.Status.Failure;
-import akka.testkit.JavaTestKit;
+import akka.testkit.javadsl.TestKit;
 import com.google.common.util.concurrent.Futures;
 import org.junit.Assert;
 import org.junit.Test;
@@ -32,7 +31,7 @@ public class RpcBrokerTest extends AbstractRpcTest {
 
     @Test
     public void testExecuteRpc() {
-        new JavaTestKit(node1) {
+        new TestKit(node1) {
             {
 
                 final ContainerNode invokeRpcResult = makeRPCOutput("bar");
@@ -42,7 +41,7 @@ public class RpcBrokerTest extends AbstractRpcTest {
 
                 final ExecuteRpc executeMsg = ExecuteRpc.from(TEST_RPC_ID, null);
 
-                rpcBroker1.tell(executeMsg, getRef());
+                rpcInvoker1.tell(executeMsg, getRef());
 
                 final RpcResponse rpcResponse = expectMsgClass(duration("5 seconds"), RpcResponse.class);
 
@@ -53,7 +52,7 @@ public class RpcBrokerTest extends AbstractRpcTest {
 
     @Test
     public void testExecuteRpcFailureWithException() {
-        new JavaTestKit(node1) {
+        new TestKit(node1) {
             {
                 when(domRpcService1.invokeRpc(eq(TEST_RPC_TYPE), Mockito.<NormalizedNode<?, ?>>any()))
                         .thenReturn(Futures.<DOMRpcResult, DOMRpcException>immediateFailedCheckedFuture(
@@ -61,7 +60,7 @@ public class RpcBrokerTest extends AbstractRpcTest {
 
                 final ExecuteRpc executeMsg = ExecuteRpc.from(TEST_RPC_ID, null);
 
-                rpcBroker1.tell(executeMsg, getRef());
+                rpcInvoker1.tell(executeMsg, getRef());
 
                 final Failure rpcResponse = expectMsgClass(duration("5 seconds"), akka.actor.Status.Failure.class);