Remove redundant exception declarations
[openflowplugin.git] / openflowplugin-impl / src / test / java / org / opendaylight / openflowplugin / impl / services / sal / SalFlatBatchServiceImplTest.java
index 14df452cb1cb2bcfe538888c34a50685a51927e2..335af88e0fd86895e308fe6453da1b9e8fddb0d9 100644 (file)
@@ -21,9 +21,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;
@@ -64,20 +64,15 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.Fl
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.AddFlowsBatchInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.AddFlowsBatchOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.AddFlowsBatchOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.RemoveFlowsBatchInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.RemoveFlowsBatchOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.RemoveFlowsBatchOutputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.SalFlowsBatchService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.UpdateFlowsBatchInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.UpdateFlowsBatchOutputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flows.service.rev160314.batch.flow.output.list.grouping.BatchFailedFlowsOutputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.AddGroupsBatchInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.AddGroupsBatchOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.RemoveGroupsBatchInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.RemoveGroupsBatchOutputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.SalGroupsBatchService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.UpdateGroupsBatchInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.UpdateGroupsBatchOutputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.batch.group.input.update.grouping.OriginalBatchedGroupBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.groups.service.rev160315.batch.group.input.update.grouping.UpdatedBatchedGroupBuilder;
@@ -87,12 +82,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.AddMetersBatchInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.AddMetersBatchOutputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.RemoveMetersBatchInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.RemoveMetersBatchOutputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.SalMetersBatchService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.UpdateMetersBatchInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.UpdateMetersBatchOutputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.batch.meter.input.update.grouping.OriginalBatchedMeterBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.batch.meter.input.update.grouping.UpdatedBatchedMeterBuilder;
@@ -124,37 +116,38 @@ public class SalFlatBatchServiceImplTest {
     private SalFlatBatchServiceImpl salFlatBatchService;
 
     @Before
-    public void setUp() throws Exception {
-        salFlatBatchService = new SalFlatBatchServiceImpl(salFlowsBatchService, salGroupsBatchService, salMetersBatchService);
+    public void setUp() {
+        salFlatBatchService =
+                new SalFlatBatchServiceImpl(salFlowsBatchService, salGroupsBatchService, salMetersBatchService);
 
     }
 
     @After
-    public void tearDown() throws Exception {
+    public void tearDown() {
         Mockito.verifyNoMoreInteractions(salFlowsBatchService, salGroupsBatchService, salMetersBatchService);
     }
 
     @Test
     public void testProcessFlatBatch_allSuccessFinished() throws Exception {
-        Mockito.when(salFlowsBatchService.addFlowsBatch(Matchers.<AddFlowsBatchInput>any()))
+        Mockito.when(salFlowsBatchService.addFlowsBatch(ArgumentMatchers.any()))
                 .thenReturn(RpcResultBuilder.success(new AddFlowsBatchOutputBuilder().build()).buildFuture());
-        Mockito.when(salFlowsBatchService.removeFlowsBatch(Matchers.<RemoveFlowsBatchInput>any()))
+        Mockito.when(salFlowsBatchService.removeFlowsBatch(ArgumentMatchers.any()))
                 .thenReturn(RpcResultBuilder.success(new RemoveFlowsBatchOutputBuilder().build()).buildFuture());
-        Mockito.when(salFlowsBatchService.updateFlowsBatch(Matchers.<UpdateFlowsBatchInput>any()))
+        Mockito.when(salFlowsBatchService.updateFlowsBatch(ArgumentMatchers.any()))
                 .thenReturn(RpcResultBuilder.success(new UpdateFlowsBatchOutputBuilder().build()).buildFuture());
 
-        Mockito.when(salGroupsBatchService.addGroupsBatch(Matchers.<AddGroupsBatchInput>any()))
+        Mockito.when(salGroupsBatchService.addGroupsBatch(ArgumentMatchers.any()))
                 .thenReturn(RpcResultBuilder.success(new AddGroupsBatchOutputBuilder().build()).buildFuture());
-        Mockito.when(salGroupsBatchService.removeGroupsBatch(Matchers.<RemoveGroupsBatchInput>any()))
+        Mockito.when(salGroupsBatchService.removeGroupsBatch(ArgumentMatchers.any()))
                 .thenReturn(RpcResultBuilder.success(new RemoveGroupsBatchOutputBuilder().build()).buildFuture());
-        Mockito.when(salGroupsBatchService.updateGroupsBatch(Matchers.<UpdateGroupsBatchInput>any()))
+        Mockito.when(salGroupsBatchService.updateGroupsBatch(ArgumentMatchers.any()))
                 .thenReturn(RpcResultBuilder.success(new UpdateGroupsBatchOutputBuilder().build()).buildFuture());
 
-        Mockito.when(salMetersBatchService.addMetersBatch(Matchers.<AddMetersBatchInput>any()))
+        Mockito.when(salMetersBatchService.addMetersBatch(ArgumentMatchers.any()))
                 .thenReturn(RpcResultBuilder.success(new AddMetersBatchOutputBuilder().build()).buildFuture());
-        Mockito.when(salMetersBatchService.removeMetersBatch(Matchers.<RemoveMetersBatchInput>any()))
+        Mockito.when(salMetersBatchService.removeMetersBatch(ArgumentMatchers.any()))
                 .thenReturn(RpcResultBuilder.success(new RemoveMetersBatchOutputBuilder().build()).buildFuture());
-        Mockito.when(salMetersBatchService.updateMetersBatch(Matchers.<UpdateMetersBatchInput>any()))
+        Mockito.when(salMetersBatchService.updateMetersBatch(ArgumentMatchers.any()))
                 .thenReturn(RpcResultBuilder.success(new UpdateMetersBatchOutputBuilder().build()).buildFuture());
 
 
@@ -176,7 +169,8 @@ public class SalFlatBatchServiceImplTest {
                 .setExitOnFirstError(true)
                 .build();
 
-        final Future<RpcResult<ProcessFlatBatchOutput>> rpcResultFuture = salFlatBatchService.processFlatBatch(batchInput);
+        final Future<RpcResult<ProcessFlatBatchOutput>> rpcResultFuture =
+                salFlatBatchService.processFlatBatch(batchInput);
         Assert.assertTrue(rpcResultFuture.isDone());
         final RpcResult<ProcessFlatBatchOutput> rpcResult = rpcResultFuture.get();
         Assert.assertTrue(rpcResult.isSuccessful());
@@ -184,17 +178,17 @@ public class SalFlatBatchServiceImplTest {
         Assert.assertTrue(rpcResult.getResult().getBatchFailure().isEmpty());
 
         final InOrder inOrder = Mockito.inOrder(salFlowsBatchService, salGroupsBatchService, salMetersBatchService);
-        inOrder.verify(salFlowsBatchService).addFlowsBatch(Matchers.<AddFlowsBatchInput>any());
-        inOrder.verify(salFlowsBatchService).removeFlowsBatch(Matchers.<RemoveFlowsBatchInput>any());
-        inOrder.verify(salFlowsBatchService).updateFlowsBatch(Matchers.<UpdateFlowsBatchInput>any());
+        inOrder.verify(salFlowsBatchService).addFlowsBatch(ArgumentMatchers.any());
+        inOrder.verify(salFlowsBatchService).removeFlowsBatch(ArgumentMatchers.any());
+        inOrder.verify(salFlowsBatchService).updateFlowsBatch(ArgumentMatchers.any());
 
-        inOrder.verify(salGroupsBatchService).addGroupsBatch(Matchers.<AddGroupsBatchInput>any());
-        inOrder.verify(salGroupsBatchService).removeGroupsBatch(Matchers.<RemoveGroupsBatchInput>any());
-        inOrder.verify(salGroupsBatchService).updateGroupsBatch(Matchers.<UpdateGroupsBatchInput>any());
+        inOrder.verify(salGroupsBatchService).addGroupsBatch(ArgumentMatchers.any());
+        inOrder.verify(salGroupsBatchService).removeGroupsBatch(ArgumentMatchers.any());
+        inOrder.verify(salGroupsBatchService).updateGroupsBatch(ArgumentMatchers.any());
 
-        inOrder.verify(salMetersBatchService).addMetersBatch(Matchers.<AddMetersBatchInput>any());
-        inOrder.verify(salMetersBatchService).removeMetersBatch(Matchers.<RemoveMetersBatchInput>any());
-        inOrder.verify(salMetersBatchService).updateMetersBatch(Matchers.<UpdateMetersBatchInput>any());
+        inOrder.verify(salMetersBatchService).addMetersBatch(ArgumentMatchers.any());
+        inOrder.verify(salMetersBatchService).removeMetersBatch(ArgumentMatchers.any());
+        inOrder.verify(salMetersBatchService).updateMetersBatch(ArgumentMatchers.any());
     }
 
     @Test
@@ -220,7 +214,8 @@ public class SalFlatBatchServiceImplTest {
                 .setExitOnFirstError(true)
                 .build();
 
-        final Future<RpcResult<ProcessFlatBatchOutput>> rpcResultFuture = salFlatBatchService.processFlatBatch(batchInput);
+        final Future<RpcResult<ProcessFlatBatchOutput>> rpcResultFuture =
+                salFlatBatchService.processFlatBatch(batchInput);
         Assert.assertTrue(rpcResultFuture.isDone());
         final RpcResult<ProcessFlatBatchOutput> rpcResult = rpcResultFuture.get();
         Assert.assertFalse(rpcResult.isSuccessful());
@@ -229,10 +224,10 @@ public class SalFlatBatchServiceImplTest {
         Assert.assertEquals(3, rpcResult.getResult().getBatchFailure().get(0).getBatchOrder().intValue());
 
         final InOrder inOrder = Mockito.inOrder(salFlowsBatchService, salGroupsBatchService, salMetersBatchService);
-        inOrder.verify(salFlowsBatchService).addFlowsBatch(Matchers.<AddFlowsBatchInput>any());
-        inOrder.verify(salFlowsBatchService).removeFlowsBatch(Matchers.<RemoveFlowsBatchInput>any());
-        inOrder.verify(salFlowsBatchService).updateFlowsBatch(Matchers.<UpdateFlowsBatchInput>any());
-        inOrder.verify(salGroupsBatchService).addGroupsBatch(Matchers.<AddGroupsBatchInput>any());
+        inOrder.verify(salFlowsBatchService).addFlowsBatch(ArgumentMatchers.any());
+        inOrder.verify(salFlowsBatchService).removeFlowsBatch(ArgumentMatchers.any());
+        inOrder.verify(salFlowsBatchService).updateFlowsBatch(ArgumentMatchers.any());
+        inOrder.verify(salGroupsBatchService).addGroupsBatch(ArgumentMatchers.any());
     }
 
     @Test
@@ -258,7 +253,8 @@ public class SalFlatBatchServiceImplTest {
                 .setExitOnFirstError(false)
                 .build();
 
-        final Future<RpcResult<ProcessFlatBatchOutput>> rpcResultFuture = salFlatBatchService.processFlatBatch(batchInput);
+        final Future<RpcResult<ProcessFlatBatchOutput>> rpcResultFuture =
+                salFlatBatchService.processFlatBatch(batchInput);
         Assert.assertTrue(rpcResultFuture.isDone());
         final RpcResult<ProcessFlatBatchOutput> rpcResult = rpcResultFuture.get();
         Assert.assertFalse(rpcResult.isSuccessful());
@@ -267,23 +263,23 @@ public class SalFlatBatchServiceImplTest {
         Assert.assertEquals(3, rpcResult.getResult().getBatchFailure().get(0).getBatchOrder().intValue());
 
         final InOrder inOrder = Mockito.inOrder(salFlowsBatchService, salGroupsBatchService, salMetersBatchService);
-        inOrder.verify(salFlowsBatchService).addFlowsBatch(Matchers.<AddFlowsBatchInput>any());
-        inOrder.verify(salFlowsBatchService).removeFlowsBatch(Matchers.<RemoveFlowsBatchInput>any());
-        inOrder.verify(salFlowsBatchService).updateFlowsBatch(Matchers.<UpdateFlowsBatchInput>any());
+        inOrder.verify(salFlowsBatchService).addFlowsBatch(ArgumentMatchers.any());
+        inOrder.verify(salFlowsBatchService).removeFlowsBatch(ArgumentMatchers.any());
+        inOrder.verify(salFlowsBatchService).updateFlowsBatch(ArgumentMatchers.any());
 
-        inOrder.verify(salGroupsBatchService).addGroupsBatch(Matchers.<AddGroupsBatchInput>any());
-        inOrder.verify(salGroupsBatchService).removeGroupsBatch(Matchers.<RemoveGroupsBatchInput>any());
-        inOrder.verify(salGroupsBatchService).updateGroupsBatch(Matchers.<UpdateGroupsBatchInput>any());
+        inOrder.verify(salGroupsBatchService).addGroupsBatch(ArgumentMatchers.any());
+        inOrder.verify(salGroupsBatchService).removeGroupsBatch(ArgumentMatchers.any());
+        inOrder.verify(salGroupsBatchService).updateGroupsBatch(ArgumentMatchers.any());
 
-        inOrder.verify(salMetersBatchService).addMetersBatch(Matchers.<AddMetersBatchInput>any());
-        inOrder.verify(salMetersBatchService).removeMetersBatch(Matchers.<RemoveMetersBatchInput>any());
-        inOrder.verify(salMetersBatchService).updateMetersBatch(Matchers.<UpdateMetersBatchInput>any());
+        inOrder.verify(salMetersBatchService).addMetersBatch(ArgumentMatchers.any());
+        inOrder.verify(salMetersBatchService).removeMetersBatch(ArgumentMatchers.any());
+        inOrder.verify(salMetersBatchService).updateMetersBatch(ArgumentMatchers.any());
     }
 
     private void prepareFirstFailingMockService() {
-        Mockito.when(salFlowsBatchService.addFlowsBatch(Matchers.<AddFlowsBatchInput>any()))
+        Mockito.when(salFlowsBatchService.addFlowsBatch(ArgumentMatchers.any()))
                 .thenReturn(RpcResultBuilder.success(new AddFlowsBatchOutputBuilder().build()).buildFuture());
-        Mockito.when(salFlowsBatchService.removeFlowsBatch(Matchers.<RemoveFlowsBatchInput>any()))
+        Mockito.when(salFlowsBatchService.removeFlowsBatch(ArgumentMatchers.any()))
                 .thenReturn(RpcResultBuilder.<RemoveFlowsBatchOutput>failed()
                         .withResult(new RemoveFlowsBatchOutputBuilder()
                                 .setBatchFailedFlowsOutput(Lists.newArrayList(
@@ -294,21 +290,21 @@ public class SalFlatBatchServiceImplTest {
                                 .build())
                         .withError(RpcError.ErrorType.APPLICATION, "ut-firstFlowAddError")
                         .buildFuture());
-        Mockito.when(salFlowsBatchService.updateFlowsBatch(Matchers.<UpdateFlowsBatchInput>any()))
+        Mockito.when(salFlowsBatchService.updateFlowsBatch(ArgumentMatchers.any()))
                 .thenReturn(RpcResultBuilder.success(new UpdateFlowsBatchOutputBuilder().build()).buildFuture());
 
-        Mockito.when(salGroupsBatchService.addGroupsBatch(Matchers.<AddGroupsBatchInput>any()))
+        Mockito.when(salGroupsBatchService.addGroupsBatch(ArgumentMatchers.any()))
                 .thenReturn(RpcResultBuilder.success(new AddGroupsBatchOutputBuilder().build()).buildFuture());
-        Mockito.when(salGroupsBatchService.removeGroupsBatch(Matchers.<RemoveGroupsBatchInput>any()))
+        Mockito.when(salGroupsBatchService.removeGroupsBatch(ArgumentMatchers.any()))
                 .thenReturn(RpcResultBuilder.success(new RemoveGroupsBatchOutputBuilder().build()).buildFuture());
-        Mockito.when(salGroupsBatchService.updateGroupsBatch(Matchers.<UpdateGroupsBatchInput>any()))
+        Mockito.when(salGroupsBatchService.updateGroupsBatch(ArgumentMatchers.any()))
                 .thenReturn(RpcResultBuilder.success(new UpdateGroupsBatchOutputBuilder().build()).buildFuture());
 
-        Mockito.when(salMetersBatchService.addMetersBatch(Matchers.<AddMetersBatchInput>any()))
+        Mockito.when(salMetersBatchService.addMetersBatch(ArgumentMatchers.any()))
                 .thenReturn(RpcResultBuilder.success(new AddMetersBatchOutputBuilder().build()).buildFuture());
-        Mockito.when(salMetersBatchService.removeMetersBatch(Matchers.<RemoveMetersBatchInput>any()))
+        Mockito.when(salMetersBatchService.removeMetersBatch(ArgumentMatchers.any()))
                 .thenReturn(RpcResultBuilder.success(new RemoveMetersBatchOutputBuilder().build()).buildFuture());
-        Mockito.when(salMetersBatchService.updateMetersBatch(Matchers.<UpdateMetersBatchInput>any()))
+        Mockito.when(salMetersBatchService.updateMetersBatch(ArgumentMatchers.any()))
                 .thenReturn(RpcResultBuilder.success(new UpdateMetersBatchOutputBuilder().build()).buildFuture());
     }
 
@@ -437,8 +433,10 @@ public class SalFlatBatchServiceImplTest {
     public void testExecuteBatchPlan() throws Exception {
         BatchStepJob batchStepJob1 = Mockito.mock(BatchStepJob.class);
         BatchStepJob batchStepJob2 = Mockito.mock(BatchStepJob.class);
-        AsyncFunction<RpcResult<ProcessFlatBatchOutput>, RpcResult<ProcessFlatBatchOutput>> function1 = Mockito.mock(AsyncFunction.class);
-        AsyncFunction<RpcResult<ProcessFlatBatchOutput>, RpcResult<ProcessFlatBatchOutput>> function2 = Mockito.mock(AsyncFunction.class);
+        AsyncFunction<RpcResult<ProcessFlatBatchOutput>, RpcResult<ProcessFlatBatchOutput>> function1 =
+                Mockito.mock(AsyncFunction.class);
+        AsyncFunction<RpcResult<ProcessFlatBatchOutput>, RpcResult<ProcessFlatBatchOutput>> function2 =
+                Mockito.mock(AsyncFunction.class);
         Mockito.when(batchStepJob1.getStepFunction()).thenReturn(function1);
         Mockito.when(batchStepJob2.getStepFunction()).thenReturn(function2);
         BatchPlanStep batchPlanStep1 = new BatchPlanStep(BatchStepType.GROUP_ADD);
@@ -448,27 +446,32 @@ public class SalFlatBatchServiceImplTest {
         Mockito.when(batchStepJob1.getPlanStep()).thenReturn(batchPlanStep1);
         Mockito.when(batchStepJob2.getPlanStep()).thenReturn(batchPlanStep2);
 
-        final ListenableFuture<RpcResult<ProcessFlatBatchOutput>> succeededChainOutput = FlatBatchUtil.createEmptyRpcBatchResultFuture(true);
+        final ListenableFuture<RpcResult<ProcessFlatBatchOutput>> succeededChainOutput =
+                FlatBatchUtil.createEmptyRpcBatchResultFuture(true);
         final ListenableFuture<RpcResult<ProcessFlatBatchOutput>> failedChainOutput =
                 RpcResultBuilder.<ProcessFlatBatchOutput>failed()
                         .withError(RpcError.ErrorType.APPLICATION, "ut-chainError")
-                        .withResult(createFlatBatchOutput(createFlowBatchFailure(0, "f1"), createFlowBatchFailure(1, "f2")))
+                        .withResult(createFlatBatchOutput(createFlowBatchFailure(0, "f1"),
+                                    createFlowBatchFailure(1, "f2")))
                         .buildFuture();
 
-        Mockito.when(batchStepJob1.getStepFunction().apply(Matchers.<RpcResult<ProcessFlatBatchOutput>>any()))
+        Mockito.when(batchStepJob1.getStepFunction().apply(ArgumentMatchers.any()))
                 .thenReturn(succeededChainOutput);
-        Mockito.when(batchStepJob2.getStepFunction().apply(Matchers.<RpcResult<ProcessFlatBatchOutput>>any()))
+        Mockito.when(batchStepJob2.getStepFunction().apply(ArgumentMatchers.any()))
                 .thenReturn(failedChainOutput);
 
         final List<BatchStepJob> batchChainElements = Lists.newArrayList(batchStepJob1, batchStepJob2);
-        final Future<RpcResult<ProcessFlatBatchOutput>> rpcResultFuture = salFlatBatchService.executeBatchPlan(batchChainElements);
+        final Future<RpcResult<ProcessFlatBatchOutput>> rpcResultFuture =
+                salFlatBatchService.executeBatchPlan(batchChainElements);
 
         Assert.assertTrue(rpcResultFuture.isDone());
         final RpcResult<ProcessFlatBatchOutput> rpcResult = rpcResultFuture.get();
         Assert.assertFalse(rpcResult.isSuccessful());
         Assert.assertEquals(1, rpcResult.getErrors().size());
         Assert.assertEquals(2, rpcResult.getResult().getBatchFailure().size());
-        Assert.assertEquals("f2", ((FlatBatchFailureFlowIdCase) rpcResult.getResult().getBatchFailure().get(1).getBatchItemIdChoice()).getFlowId().getValue());
+        Assert.assertEquals("f2",
+                ((FlatBatchFailureFlowIdCase) rpcResult.getResult().getBatchFailure().get(1).getBatchItemIdChoice())
+                        .getFlowId().getValue());
     }
 
     private BatchFailure createFlowBatchFailure(final int batchOrder, final String flowIdValue) {
@@ -499,19 +502,20 @@ public class SalFlatBatchServiceImplTest {
 
         Assert.assertEquals(1, batchChain.size());
 
-        Mockito.when(salFlowsBatchService.addFlowsBatch(Matchers.<AddFlowsBatchInput>any()))
+        Mockito.when(salFlowsBatchService.addFlowsBatch(ArgumentMatchers.any()))
                 .thenReturn(RpcResultBuilder
                         .success(new AddFlowsBatchOutputBuilder().build())
                         .buildFuture());
 
-        final Future<RpcResult<ProcessFlatBatchOutput>> rpcResultFuture = salFlatBatchService.executeBatchPlan(batchChain);
+        final Future<RpcResult<ProcessFlatBatchOutput>> rpcResultFuture =
+                salFlatBatchService.executeBatchPlan(batchChain);
         Assert.assertTrue(rpcResultFuture.isDone());
         final RpcResult<ProcessFlatBatchOutput> rpcResult = rpcResultFuture.get();
         Assert.assertTrue(rpcResult.isSuccessful());
         Assert.assertEquals(0, rpcResult.getErrors().size());
         Assert.assertEquals(0, rpcResult.getResult().getBatchFailure().size());
 
-        Mockito.verify(salFlowsBatchService).addFlowsBatch(Matchers.<AddFlowsBatchInput>any());
+        Mockito.verify(salFlowsBatchService).addFlowsBatch(ArgumentMatchers.any());
     }
 
     @Test
@@ -528,7 +532,7 @@ public class SalFlatBatchServiceImplTest {
 
         Assert.assertEquals(2, batchChain.size());
 
-        Mockito.when(salFlowsBatchService.addFlowsBatch(Matchers.<AddFlowsBatchInput>any()))
+        Mockito.when(salFlowsBatchService.addFlowsBatch(ArgumentMatchers.any()))
                 .thenReturn(RpcResultBuilder
                         .<AddFlowsBatchOutput>failed()
                         .withResult(new AddFlowsBatchOutputBuilder()
@@ -545,7 +549,8 @@ public class SalFlatBatchServiceImplTest {
                         .withError(RpcError.ErrorType.APPLICATION, "ut-addFlowBatchError")
                         .buildFuture());
 
-        final Future<RpcResult<ProcessFlatBatchOutput>> rpcResultFuture = salFlatBatchService.executeBatchPlan(batchChain);
+        final Future<RpcResult<ProcessFlatBatchOutput>> rpcResultFuture =
+                salFlatBatchService.executeBatchPlan(batchChain);
         Assert.assertTrue(rpcResultFuture.isDone());
         final RpcResult<ProcessFlatBatchOutput> rpcResult = rpcResultFuture.get();
         Assert.assertFalse(rpcResult.isSuccessful());