protected void replicateAndVerify(ReplicationTestSetup testSetup, String expectedStr) throws Exception {

    // Do the replica metadata exchange.
    testSetup.replicaThread.replicate();

    // Verify
    String[] expectedResults = expectedStr.equals("") ? new String[0] : expectedStr.split("\\s");
    PartitionId partitionId = testSetup.partitionIds.get(0);
    int size = testSetup.localHost.infosByPartition.get(partitionId).size();
    assertEquals("Mismatch in number of messages on local host after replication", expectedResults.length, size);
    for (int i = 0; i < size; ++i) {
      String blobIdStr = testSetup.localHost.infosByPartition.get(partitionId).get(i).getStoreKey().toString();
      boolean isDeleteMessage = testSetup.localHost.infosByPartition.get(partitionId).get(i).isDeleted();
      switch (expectedResults[i]) {
        case "OP":
          assertEquals("Mismatch in blodId on local host after replication", testSetup.oldKey.toString(), blobIdStr);
          assertFalse("Mismatch in message type on local host after replication", isDeleteMessage);
          break;
        case "OD":
          assertEquals("Mismatch in blodId on local host after replication", testSetup.oldKey.toString(), blobIdStr);
          assertTrue("Mismatch in message type on local host after replication", isDeleteMessage);
          break;
        case "NP":
          assertEquals("Mismatch in blodId on local host after replication", testSetup.newKey.toString(), blobIdStr);
          assertFalse("Mismatch in message type on local host after replication", isDeleteMessage);
          break;
        case "ND":
          assertEquals("Mismatch in blodId on local host after replication", testSetup.newKey.toString(), blobIdStr);
          assertTrue("Mismatch in message type on local host after replication", isDeleteMessage);
          break;
      }
    }
  }
Replicate between local and remote hosts and verify the results on local host are expected.
1.remote host has different versions of blobIds and local host is empty;
2.remote and local hosts have different conversion maps (StoreKeyConverter).
@param testSetup the {@link ReplicationTestSetup} used to provide test environment info.
@param expectedStr the string presenting expected sequence of PUT, DELETE messages on local host.
@throws Exception
ambry-replication/src/test/java/com/github/ambry/replication/ReplicationTestHelper.java