X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-remoterpc-connector%2Fimplementation%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fconnector%2Fremoterpc%2FClientImplTest.java;h=f8d14ce62e190a19faf1496b73923cb1a4d25ad0;hp=c0aae2dfb56590a39ac1e90a5a413b29c2a87cdb;hb=8ce1f7c0dc98e3f49698325187ef5e895a0617e8;hpb=4b5f54e25c08fc21c955ff75901abe96b12d3340 diff --git a/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/test/java/org/opendaylight/controller/sal/connector/remoterpc/ClientImplTest.java b/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/test/java/org/opendaylight/controller/sal/connector/remoterpc/ClientImplTest.java index c0aae2dfb5..f8d14ce62e 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/test/java/org/opendaylight/controller/sal/connector/remoterpc/ClientImplTest.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/test/java/org/opendaylight/controller/sal/connector/remoterpc/ClientImplTest.java @@ -7,29 +7,25 @@ */ package org.opendaylight.controller.sal.connector.remoterpc; -import com.google.common.base.Optional; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.io.IOException; + import junit.framework.Assert; + import org.junit.After; import org.junit.Before; import org.junit.Test; -import org.opendaylight.controller.sal.common.util.Rpcs; import org.opendaylight.controller.sal.connector.api.RpcRouter; -import org.opendaylight.controller.sal.connector.remoterpc.api.RouteChangeListener; import org.opendaylight.controller.sal.connector.remoterpc.api.RoutingTable; -import org.opendaylight.controller.sal.connector.remoterpc.api.RoutingTableException; -import org.opendaylight.controller.sal.connector.remoterpc.api.SystemException; import org.opendaylight.controller.sal.connector.remoterpc.dto.Message; import org.opendaylight.controller.sal.connector.remoterpc.utils.MessagingUtil; -import org.opendaylight.yangtools.yang.common.RpcError; import org.opendaylight.yangtools.yang.common.RpcResult; import org.opendaylight.yangtools.yang.data.api.CompositeNode; -import java.io.IOException; -import java.util.*; - -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; +import com.google.common.base.Optional; /** * @@ -44,8 +40,8 @@ public class ClientImplTest { //mock routing table routingTableProvider = mock(RoutingTableProvider.class); - RoutingTable mockRoutingTable = new MockRoutingTable(); - Optional> optionalRoutingTable = Optional.fromNullable(mockRoutingTable); + RoutingTable, String> mockRoutingTable = new MockRoutingTable(); + Optional, String>> optionalRoutingTable = Optional.fromNullable(mockRoutingTable); when(routingTableProvider.getRoutingTable()).thenReturn(optionalRoutingTable); //mock ClientRequestHandler @@ -88,7 +84,7 @@ public class ClientImplTest { when(mockHandler.handle(any(Message.class))). thenReturn(MessagingUtil.createEmptyMessage()); - RpcResult result = client.invokeRpc(null, null); + RpcResult result = client.invokeRpc(null, null).get(); Assert.assertTrue(result.isSuccessful()); Assert.assertTrue(result.getErrors().isEmpty()); @@ -101,7 +97,7 @@ public class ClientImplTest { when(mockHandler.handle(any(Message.class))). thenThrow(new IOException()); - RpcResult result = client.invokeRpc(null, null); + RpcResult result = client.invokeRpc(null, null).get(); Assert.assertFalse(result.isSuccessful()); Assert.assertFalse(result.getErrors().isEmpty());