Siddhant Sangwan created HDDS-8675:
--------------------------------------

             Summary: Fix "expectation" vs "actual" in 
testUnderRepSentToOverRepHandlerIfNoNewNodes
                 Key: HDDS-8675
                 URL: https://issues.apache.org/jira/browse/HDDS-8675
             Project: Apache Ozone
          Issue Type: Sub-task
          Components: SCM
            Reporter: Siddhant Sangwan
            Assignee: Siddhant Sangwan


Looks like we're writing the expected result into the actual result and 
comparing them:
{code}
      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));
{code}

{{commandsSent}} should be populated with the actual command that was sent.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to