ServiceUserConfigService { public Set<String> getServiceUserGroups(Map<String, Map<String, String>> serviceUserConfigs) { Set<String> serviceUserGroups = null; if (!MapUtils.isEmpty(serviceUserConfigs)) { serviceUserGroups = new HashSet<>(); for (Map<String, String> serviceUserConfig : serviceUserConfigs.values()) { serviceUserGroups.add(serviceUserConfig.get(UserMgmtConstants.SERVICE_USER_GROUP)); } LOGGER.info("Service user groups are " + new Gson().toJson(serviceUserGroups)); } return serviceUserGroups; }  Map<String, Map<String, String>> getServiceUserConfigs(String clusterName); Set<String> getServiceUserGroups(Map<String, Map<String, String>> serviceUserConfigs);  }
@Test public void testGetServiceUserGroups() throws Exception { Map<String, Map<String, String>> serviceUserConfigs = new HashMap<>(); Map<String, String> config = new HashMap<>(); config.put(UserMgmtConstants.SERVICE_USER_GROUP, "hadoop_group"); serviceUserConfigs.put("HDFS", config); assertTrue(userConfigService.getServiceUserGroups(serviceUserConfigs).contains("hadoop_group")); }