diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestECUnderReplicationHandler.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestECUnderReplicationHandler.java index 3e783bfd65a..4ee5406b5ab 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestECUnderReplicationHandler.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestECUnderReplicationHandler.java @@ -466,29 +466,16 @@ public void testUnderRepSentToOverRepHandlerIfNoNewNodes() () -> ecURH.processAndSendCommands(availableReplicas, Collections.emptyList(), underRep, 2)); - // Now adjust replicas so it is also over replicated. This time rather - // than throwing it should call the OverRepHandler and return whatever it + // Now adjust replicas so it is also over replicated. This time before + // throwing it should call the OverRepHandler and return whatever it // returns, which in this case is a delete command for replica index 4. availableReplicas.add(overRepReplica); - Set>> expectedDelete = - new HashSet<>(); - expectedDelete.add(Pair.of(overRepReplica.getDatanodeDetails(), - createDeleteContainerCommand(container, - overRepReplica.getReplicaIndex()))); - - Mockito.when(replicationManager.processOverReplicatedContainer( - underRep)).thenAnswer(invocationOnMock -> { - commandsSent.addAll(expectedDelete); - return expectedDelete.size(); - }); - commandsSent.clear(); assertThrows(SCMException.class, () -> ecURH.processAndSendCommands(availableReplicas, Collections.emptyList(), underRep, 2)); Mockito.verify(replicationManager, times(1)) .processOverReplicatedContainer(underRep); - Assertions.assertEquals(true, expectedDelete.equals(commandsSent)); } }