AppConfigValidationFactory { @SuppressWarnings("unchecked") public static ValidateResult blackListHandle(Map<String, Object> config) { ValidateResult validateResult = new ValidateResult(); String jsonStr = CommonUtil.readJsonFile("blacklist.json"); Gson gson = new Gson(); List<Map<String, Map<String, List<String>>>> blackList = gson.fromJson(jsonStr, List.class); return processAppConfigValidation(config, validateResult, blackList, ValidationType.BLACK_LIST); }  @SuppressWarnings("unchecked") static void validateConfigType(Map<String, Object> config, List<String> warningMsgList); @SuppressWarnings("unchecked") static ValidateResult blackListHandle(Map<String, Object> config); @SuppressWarnings("unchecked") static ValidateResult whiteListHandle(Map<String, Object> config);  }
@Test public void testBlackListHandle() { ValidateResult validateResult=AppConfigValidationFactory.blackListHandle(cluster.getConfiguration()); assertEquals(validateResult.getType(),ValidateResult.Type.NAME_IN_BLACK_LIST); assertEquals(validateResult.getFailureNames().get(0), "dfs.http.address"); assertEquals(validateResult.getFailureNames().get(1), "mapred.task.cache.levels"); assertEquals(validateResult.getFailureNames().get(2), "hbase.cluster.distributed"); }