/*
- * 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,
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;
@Test
public void testExecuteRpc() {
- new JavaTestKit(node1) {
+ new TestKit(node1) {
{
final ContainerNode invokeRpcResult = makeRPCOutput("bar");
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);
@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(
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);