@Test
public void testParseNameServices() throws Exception {

  Map<String, String> hdfsSiteConfigMap =
    new HashMap<String, String>();
  hdfsSiteConfigMap.put("dfs.nameservices", "serviceOne");
  // verify that a dfs.internal.nameservices parsing falls back to dfs.nameservices
  String[] result = BlueprintConfigurationProcessor.parseNameServices(hdfsSiteConfigMap);
  assertNotNull("Resulting array was null",
    result);
  assertEquals("Incorrect array size",
    1, result.length);
  assertEquals("Incorrect value for returned name service",
    "serviceOne", result[0]);
  hdfsSiteConfigMap.put("dfs.internal.nameservices", "serviceTwo");
  // verify that a single service is parsed correctly
  result = BlueprintConfigurationProcessor.parseNameServices(hdfsSiteConfigMap);
  assertNotNull("Resulting array was null",
    result);
  assertEquals("Incorrect array size",
    1, result.length);
  assertEquals("Incorrect value for returned name service",
    "serviceTwo", result[0]);
  // verify that multiple services are parsed correctly
  hdfsSiteConfigMap.put("dfs.internal.nameservices", " serviceTwo, serviceThree, serviceFour");
  String[] resultTwo = BlueprintConfigurationProcessor.parseNameServices(hdfsSiteConfigMap);
  assertNotNull("Resulting array was null",
    resultTwo);
  assertEquals("Incorrect array size",
    3, resultTwo.length);
  assertEquals("Incorrect value for returned name service",
    "serviceTwo", resultTwo[0]);
  assertEquals("Incorrect value for returned name service",
    "serviceThree", resultTwo[1]);
  assertEquals("Incorrect value for returned name service",
    "serviceFour", resultTwo[2]);
}