diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/TestReplicationManager.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/TestReplicationManager.java index bc921e3ce5..35fd108812 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/TestReplicationManager.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/TestReplicationManager.java @@ -96,10 +96,10 @@ public void setup() throws IOException, InterruptedException { containerPlacementPolicy = Mockito.mock(ContainerPlacementPolicy.class); Mockito.when(containerPlacementPolicy.chooseDatanodes( - Mockito.anyListOf(DatanodeDetails.class), null, - Mockito.anyInt(), Mockito.anyLong())) - .thenAnswer(invocation -> { - int count = (int) invocation.getArguments()[1]; + Mockito.anyListOf(DatanodeDetails.class), + Mockito.anyListOf(DatanodeDetails.class), Mockito.anyInt(), + Mockito.anyLong())).thenAnswer(invocation -> { + int count = (int) invocation.getArguments()[2]; return IntStream.range(0, count) .mapToObj(i -> randomDatanodeDetails()) .collect(Collectors.toList());