@Test
public void testValidation() throws IOException {

  Map<String, String> destinations = new HashMap<>();
  destinations.put("ns0", "/testValidate-dest");
  try {
    MountTable.newInstance("testValidate", destinations);
    fail("Mount table entry should be created failed.");
  } catch (Exception e) {
    GenericTestUtils.assertExceptionContains(
        MountTable.ERROR_MSG_MUST_START_WITH_BACK_SLASH, e);
  }
  destinations.clear();
  destinations.put("ns0", "testValidate-dest");
  try {
    MountTable.newInstance("/testValidate", destinations);
    fail("Mount table entry should be created failed.");
  } catch (Exception e) {
    GenericTestUtils.assertExceptionContains(
        MountTable.ERROR_MSG_ALL_DEST_MUST_START_WITH_BACK_SLASH, e);
  }
  destinations.clear();
  destinations.put("", "/testValidate-dest");
  try {
    MountTable.newInstance("/testValidate", destinations);
    fail("Mount table entry should be created failed.");
  } catch (Exception e) {
    GenericTestUtils.assertExceptionContains(
        MountTable.ERROR_MSG_INVAILD_DEST_NS, e);
  }
  destinations.clear();
  destinations.put("ns0", "/testValidate-dest");
  MountTable record = MountTable.newInstance("/testValidate", destinations);
  assertNotNull(record);
}