### Question:
BlueprintConfigurationProcessor { static String[] parseNameServices(Map<String, String> properties) { String nameServices = properties.get("dfs.internal.nameservices"); if (nameServices == null) { nameServices = properties.get("dfs.nameservices"); } return splitAndTrimStrings(nameServices); } BlueprintConfigurationProcessor(ClusterTopology clusterTopology); Map<String, Map<String, PropertyUpdater>> getRemovePropertyUpdaters(); void initRemovePropertyUpdaters(); Set<String> getRequiredHostGroups(); Set<String> doUpdateForClusterCreate(); void doUpdateForBlueprintExport(); void doNameNodeHAUpdate(); void doYarnResourceManagerHAUpdate(); void doOozieServerHAUpdate(); static final Map<String, Set<String>> TEMPORARY_PROPERTIES_FOR_CLUSTER_DEPLOYMENT; }### Answer:
@Test public void testParseNameServices() throws Exception { Map<String, String> hdfsSiteConfigMap = new HashMap<>(); hdfsSiteConfigMap.put("dfs.nameservices", "serviceOne"); 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"); 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]); 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]); }