X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflowplugin-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fopenflowplugin%2Fimpl%2Fservices%2FMultipartRequestCallbackTest.java;h=110cf1d75f5e2ba7dfc613ac941068a3e2464d6d;hb=HEAD;hp=81c22459b1f1e1f90d19a3c9e65302a1e763de43;hpb=5ba35748d3bdaf34f96de152142a99e20d058b24;p=openflowplugin.git diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/MultipartRequestCallbackTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/MultipartRequestCallbackTest.java index 81c22459b1..110cf1d75f 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/MultipartRequestCallbackTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/MultipartRequestCallbackTest.java @@ -14,16 +14,15 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; +import org.mockito.ArgumentMatchers; import org.mockito.Captor; -import org.mockito.Matchers; import org.mockito.Mock; import org.mockito.Mockito; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import org.mockito.stubbing.OngoingStubbing; import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext; import org.opendaylight.openflowplugin.api.openflow.device.RequestContext; import org.opendaylight.openflowplugin.api.openflow.device.handlers.MultiMsgCollector; -import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.EventIdentifier; import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageSpy; import org.opendaylight.openflowplugin.impl.services.multilayer.MultiLayerMultipartRequestCallback; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoOutputBuilder; @@ -53,12 +52,12 @@ public class MultipartRequestCallbackTest { private AbstractMultipartRequestCallback multipartRequestCallback; @Before - public void setUp() throws Exception { + public void setUp() { Mockito.doNothing().when(requestContext).setResult(rpcResultCapt.capture()); Mockito.when(deviceContext.getMessageSpy()).thenReturn(spy); final OngoingStubbing> when = - Mockito.when(deviceContext.getMultiMsgCollector(Matchers.any())); + Mockito.when(deviceContext.getMultiMsgCollector(ArgumentMatchers.any())); when.thenReturn(multiMsgCollector); multipartRequestCallback = new MultiLayerMultipartRequestCallback<>(requestContext, MultipartRequestInput.class, @@ -70,16 +69,16 @@ public class MultipartRequestCallbackTest { * End collecting. */ @Test - public void testOnSuccess1() throws Exception { + public void testOnSuccess1() { multipartRequestCallback.onSuccess(null); - Mockito.verify(multiMsgCollector).endCollecting(Matchers.any()); + Mockito.verify(multiMsgCollector).endCollecting(ArgumentMatchers.any()); } /** * Fail adding to collection. */ @Test - public void testOnSuccess2() throws Exception { + public void testOnSuccess2() { multipartRequestCallback.onSuccess(new EchoOutputBuilder().build()); final RpcResult> rpcResult = rpcResultCapt.getValue(); Assert.assertNotNull(rpcResult); @@ -90,10 +89,10 @@ public class MultipartRequestCallbackTest { * Successfully added to collection. */ @Test - public void testOnSuccess3() throws Exception { + public void testOnSuccess3() { final MultipartReplyMessage replyMessage = new MultipartReplyMessageBuilder().build(); multipartRequestCallback.onSuccess(replyMessage); Mockito.verify(multiMsgCollector) - .addMultipartMsg(Matchers.eq(replyMessage), Matchers.eq(false), Matchers.any()); + .addMultipartMsg(ArgumentMatchers.eq(replyMessage), ArgumentMatchers.eq(false), ArgumentMatchers.any()); } }