OPNFLWPLUG-1032: Neon-MRI: Bump odlparent, yangtools, mdsal
[openflowplugin.git] / openflowplugin-impl / src / test / java / org / opendaylight / openflowplugin / impl / services / sal / SalFlowsBatchServiceImplTest.java
index e3927efea3f17debc732ee93796a528c488ebd20..e5f9b77e5c70b01eb3dfa85f562f9d62d4fb6573 100644 (file)
@@ -17,9 +17,9 @@ 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.InOrder;
-import org.mockito.Matchers;
 import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.runners.MockitoJUnitRunner;
@@ -36,6 +36,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.Upda
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowOutputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.FlowCapableTransactionService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.SendBarrierOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.AddFlowsBatchInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.AddFlowsBatchInputBuilder;
@@ -98,8 +99,8 @@ public class SalFlowsBatchServiceImplTest {
     public void setUp() throws Exception {
         salFlowsBatchService = new SalFlowsBatchServiceImpl(salFlowService, transactionService);
 
-        Mockito.when(transactionService.sendBarrier(Matchers.<SendBarrierInput>any()))
-                .thenReturn(RpcResultBuilder.<Void>success().buildFuture());
+        Mockito.when(transactionService.sendBarrier(ArgumentMatchers.<SendBarrierInput>any()))
+                .thenReturn(RpcResultBuilder.<SendBarrierOutput>success().buildFuture());
     }
 
     @After
@@ -109,7 +110,7 @@ public class SalFlowsBatchServiceImplTest {
 
     @Test
     public void testRemoveFlowsBatch_success() throws Exception {
-        Mockito.when(salFlowService.removeFlow(Matchers.<RemoveFlowInput>any()))
+        Mockito.when(salFlowService.removeFlow(ArgumentMatchers.<RemoveFlowInput>any()))
                 .thenReturn(RpcResultBuilder.success(new RemoveFlowOutputBuilder().build())
                         .buildFuture());
 
@@ -140,12 +141,12 @@ public class SalFlowsBatchServiceImplTest {
         Assert.assertEquals(42, allValues.get(0).getPriority().longValue());
         Assert.assertEquals(43, allValues.get(1).getPriority().longValue());
 
-        inOrder.verify(transactionService).sendBarrier(Matchers.<SendBarrierInput>any());
+        inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
     }
 
     @Test
     public void testRemoveFlowsBatch_failed() throws Exception {
-        Mockito.when(salFlowService.removeFlow(Matchers.<RemoveFlowInput>any()))
+        Mockito.when(salFlowService.removeFlow(ArgumentMatchers.<RemoveFlowInput>any()))
                 .thenReturn(RpcResultBuilder.<RemoveFlowOutput>failed()
                         .withError(RpcError.ErrorType.APPLICATION, "flow-remove-fail-1")
                         .buildFuture());
@@ -177,7 +178,7 @@ public class SalFlowsBatchServiceImplTest {
         Assert.assertEquals(42, allValues.get(0).getPriority().longValue());
         Assert.assertEquals(43, allValues.get(1).getPriority().longValue());
 
-        inOrder.verify(transactionService).sendBarrier(Matchers.<SendBarrierInput>any());
+        inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
     }
 
     private static BatchAddFlows createEmptyBatchAddFlow(final String flowIdValue, final int priority) {
@@ -210,7 +211,7 @@ public class SalFlowsBatchServiceImplTest {
 
     @Test
     public void testAddFlowsBatch_success() throws Exception {
-        Mockito.when(salFlowService.addFlow(Matchers.<AddFlowInput>any()))
+        Mockito.when(salFlowService.addFlow(ArgumentMatchers.<AddFlowInput>any()))
                 .thenReturn(RpcResultBuilder.success(new AddFlowOutputBuilder().build()).buildFuture());
 
         final AddFlowsBatchInput input = new AddFlowsBatchInputBuilder()
@@ -234,12 +235,12 @@ public class SalFlowsBatchServiceImplTest {
         Assert.assertEquals(42, allValues.get(0).getPriority().longValue());
         Assert.assertEquals(43, allValues.get(1).getPriority().longValue());
 
-        inOrder.verify(transactionService).sendBarrier(Matchers.<SendBarrierInput>any());
+        inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
     }
 
     @Test
     public void testAddFlowsBatch_failed() throws Exception {
-        Mockito.when(salFlowService.addFlow(Matchers.<AddFlowInput>any()))
+        Mockito.when(salFlowService.addFlow(ArgumentMatchers.<AddFlowInput>any()))
                 .thenReturn(RpcResultBuilder
                         .<AddFlowOutput>failed().withError(RpcError.ErrorType.APPLICATION, "ut-groupAddError")
                         .buildFuture());
@@ -271,12 +272,12 @@ public class SalFlowsBatchServiceImplTest {
         Assert.assertEquals(42, allValues.get(0).getPriority().longValue());
         Assert.assertEquals(43, allValues.get(1).getPriority().longValue());
 
-        inOrder.verify(transactionService).sendBarrier(Matchers.<SendBarrierInput>any());
+        inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
     }
 
     @Test
     public void testUpdateFlowsBatch_success() throws Exception {
-        Mockito.when(salFlowService.updateFlow(Matchers.<UpdateFlowInput>any()))
+        Mockito.when(salFlowService.updateFlow(ArgumentMatchers.<UpdateFlowInput>any()))
                 .thenReturn(RpcResultBuilder.success(new UpdateFlowOutputBuilder().build()).buildFuture());
 
         final UpdateFlowsBatchInput input = new UpdateFlowsBatchInputBuilder()
@@ -302,12 +303,12 @@ public class SalFlowsBatchServiceImplTest {
         Assert.assertEquals(44, allValues.get(1).getOriginalFlow().getPriority().longValue());
         Assert.assertEquals(45, allValues.get(1).getUpdatedFlow().getPriority().longValue());
 
-        inOrder.verify(transactionService).sendBarrier(Matchers.<SendBarrierInput>any());
+        inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
     }
 
     @Test
     public void testUpdateFlowsBatch_failure() throws Exception {
-        Mockito.when(salFlowService.updateFlow(Matchers.<UpdateFlowInput>any()))
+        Mockito.when(salFlowService.updateFlow(ArgumentMatchers.<UpdateFlowInput>any()))
                 .thenReturn(RpcResultBuilder.<UpdateFlowOutput>failed()
                         .withError(RpcError.ErrorType.APPLICATION, "ut-flowUpdateError")
                         .buildFuture());
@@ -341,6 +342,6 @@ public class SalFlowsBatchServiceImplTest {
         Assert.assertEquals(44, allValues.get(1).getOriginalFlow().getPriority().longValue());
         Assert.assertEquals(45, allValues.get(1).getUpdatedFlow().getPriority().longValue());
 
-        inOrder.verify(transactionService).sendBarrier(Matchers.<SendBarrierInput>any());
+        inOrder.verify(transactionService).sendBarrier(ArgumentMatchers.<SendBarrierInput>any());
     }
 }