SerializableRestoreRedundancyResultsImpl extends RestoreRedundancyResultsImpl implements DataSerializableFixedID { public void addPrimaryReassignmentDetails(PartitionRebalanceInfo details) { totalPrimaryTransfersCompleted += details.getPrimaryTransfersCompleted(); totalPrimaryTransferTime += details.getPrimaryTransferTime(); }  void addPrimaryReassignmentDetails(PartitionRebalanceInfo details); @Override int getDSFID(); @Override void toData(DataOutput out, SerializationContext context); @Override void fromData(DataInput in, DeserializationContext context); @Override KnownVersion[] getSerializationVersions();  }
@Test public void getMessageReturnsStatusForAllRegionsAndPrimaryInfo() { results.addRegionResult(successfulRegionResult); results.addRegionResult(underRedundancyRegionResult); results.addRegionResult(zeroRedundancyRegionResult); results.addPrimaryReassignmentDetails(details); String message = results.getRegionOperationMessage(); List<String> messageLines = Arrays.asList(message.split(System.lineSeparator())); assertThat(messageLines).contains(NO_REDUNDANT_COPIES_FOR_REGIONS, zeroRedundancyRegionResult.toString(), REDUNDANCY_NOT_SATISFIED_FOR_REGIONS, underRedundancyRegionResult.toString(), REDUNDANCY_SATISFIED_FOR_REGIONS, successfulRegionResult.toString(), PRIMARY_TRANSFERS_COMPLETED + transfersCompleted, PRIMARY_TRANSFER_TIME + transferTime); }
@Test public void addPrimaryDetailsUpdatesValue() { assertThat(results.getTotalPrimaryTransfersCompleted()).isEqualTo(0); assertThat(results.getTotalPrimaryTransferTime()).isEqualTo(0L); results.addPrimaryReassignmentDetails(details); assertThat(results.getTotalPrimaryTransfersCompleted()).isEqualTo(transfersCompleted); assertThat(results.getTotalPrimaryTransferTime()).isEqualTo(transferTime); results.addPrimaryReassignmentDetails(details); assertThat(results.getTotalPrimaryTransfersCompleted()).isEqualTo(transfersCompleted * 2); assertThat(results.getTotalPrimaryTransferTime()).isEqualTo(transferTime * 2); }