Details
-
Sub-task
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
Description
Looks like we're writing the expected result into the actual result and comparing them:
Set<Pair<DatanodeDetails, SCMCommand<?>>> 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));
commandsSent should be populated with the actual command that was sent.
Attachments
Issue Links
- links to