@Test
public void testValidation() {

  helixMirrorMakerManager.addTopicToMirrorMaker("testTopic0", 1);
  // {"ExternalView":{"Server_localhost_0":1},
  // "IdealState":{"Server_localhost_0":1},
  // "numErrorTopicPartitions":0,
  // "numErrorTopics":0,
  // "numOfflineTopicPartitions":0,
  // "numOnlineTopicPartitions":1,
  // "numTopicPartitions":1,
  // "numTopics":1}
  try {
    Thread.sleep(3000);
  } catch (Exception e) {
  }
  JSONObject validationResultJson =
      JSONObject.parseObject(validationManager.validateExternalView());
  Assert.assertEquals(validationResultJson.getIntValue("numErrorTopicPartitions"), 0);
  Assert.assertEquals(validationResultJson.getIntValue("numErrorTopics"), 0);
  Assert.assertEquals(validationResultJson.getIntValue("numOfflineTopicPartitions"), 0);
  Assert.assertEquals(validationResultJson.getIntValue("numOnlineTopicPartitions"), 1);
  Assert.assertEquals(validationResultJson.getIntValue("numTopicPartitions"), 1);
  Assert.assertEquals(validationResultJson.getIntValue("numTopics"), 1);
  helixMirrorMakerManager.addTopicToMirrorMaker("testTopic1", 2);
  try {
    Thread.sleep(3000);
  } catch (Exception e) {
  }
  validationResultJson = JSONObject.parseObject(validationManager.validateExternalView());
  Assert.assertEquals(validationResultJson.getIntValue("numErrorTopicPartitions"), 0);
  Assert.assertEquals(validationResultJson.getIntValue("numErrorTopics"), 0);
  Assert.assertEquals(validationResultJson.getIntValue("numOfflineTopicPartitions"), 0);
  Assert.assertEquals(validationResultJson.getIntValue("numOnlineTopicPartitions"), 3);
  Assert.assertEquals(validationResultJson.getIntValue("numTopicPartitions"), 3);
  Assert.assertEquals(validationResultJson.getIntValue("numTopics"), 2);
}