@Test public void testMemberGroups() throws IOException, AcConfigBeanValidationException, RepositoryException { final ConfigReader yamlConfigReader = new YamlConfigReader(); final List<Map> yamlList = getYamlList("test-membergroups.yaml"); final Set<AuthorizableConfigBean> groups = yamlConfigReader.getGroupConfigurationBeans(yamlList, null); assertEquals("Number of groups", 4, groups.size()); Iterator<AuthorizableConfigBean> groupsIt = groups.iterator(); AuthorizableConfigBean firstGroup = groupsIt.next(); assertArrayEquals(null, firstGroup.getMembers()); assertEquals("groupA", firstGroup.getAuthorizableId()); AuthorizableConfigBean secondGroup = groupsIt.next(); assertEquals("groupB", secondGroup.getAuthorizableId()); assertArrayEquals(new String[] {"groupA"}, secondGroup.getMembers()); AuthorizableConfigBean thirdGroup = groupsIt.next(); assertEquals("groupC", thirdGroup.getAuthorizableId()); assertEquals("/home/groups/g", thirdGroup.getPath()); }
@Override public AuthorizablesConfig getGroupConfigurationBeans(final Collection yamlList, final AuthorizableValidator authorizableValidator) throws AcConfigBeanValidationException { final List<LinkedHashMap> authorizableList = (List<LinkedHashMap>) getConfigSection(Constants.GROUP_CONFIGURATION_KEY, yamlList); if (authorizableList == null) { LOG.debug("Group configuration not found in this YAML configuration file"); return null; } AuthorizablesConfig authorizableBeans = getAuthorizableBeans(authorizableList, authorizableValidator, true); return authorizableBeans; }
YamlConfigReader implements ConfigReader { @Override public AuthorizablesConfig getGroupConfigurationBeans(final Collection yamlList, final AuthorizableValidator authorizableValidator) throws AcConfigBeanValidationException { final List<LinkedHashMap> authorizableList = (List<LinkedHashMap>) getConfigSection(Constants.GROUP_CONFIGURATION_KEY, yamlList); if (authorizableList == null) { LOG.debug("Group configuration not found in this YAML configuration file"); return null; } AuthorizablesConfig authorizableBeans = getAuthorizableBeans(authorizableList, authorizableValidator, true); return authorizableBeans; } }
YamlConfigReader implements ConfigReader { @Override public AuthorizablesConfig getGroupConfigurationBeans(final Collection yamlList, final AuthorizableValidator authorizableValidator) throws AcConfigBeanValidationException { final List<LinkedHashMap> authorizableList = (List<LinkedHashMap>) getConfigSection(Constants.GROUP_CONFIGURATION_KEY, yamlList); if (authorizableList == null) { LOG.debug("Group configuration not found in this YAML configuration file"); return null; } AuthorizablesConfig authorizableBeans = getAuthorizableBeans(authorizableList, authorizableValidator, true); return authorizableBeans; }  }
YamlConfigReader implements ConfigReader { @Override public AuthorizablesConfig getGroupConfigurationBeans(final Collection yamlList, final AuthorizableValidator authorizableValidator) throws AcConfigBeanValidationException { final List<LinkedHashMap> authorizableList = (List<LinkedHashMap>) getConfigSection(Constants.GROUP_CONFIGURATION_KEY, yamlList); if (authorizableList == null) { LOG.debug("Group configuration not found in this YAML configuration file"); return null; } AuthorizablesConfig authorizableBeans = getAuthorizableBeans(authorizableList, authorizableValidator, true); return authorizableBeans; }  @Override @SuppressWarnings("rawtypes") AcesConfig getAceConfigurationBeans(final Collection<?> aceConfigData,
            final AceBeanValidator aceBeanValidator, Session session, String sourceFile); @Override AuthorizablesConfig getGroupConfigurationBeans(final Collection yamlList,
            final AuthorizableValidator authorizableValidator); @Override AuthorizablesConfig getUserConfigurationBeans(final Collection yamlList,
            final AuthorizableValidator authorizableValidator); @Override GlobalConfiguration getGlobalConfiguration(final Collection yamlList); @Override Set<String> getObsoluteAuthorizables(final Collection yamlList); static String[] parseActionsString(final String actionsStringFromConfig); }
YamlConfigReader implements ConfigReader { @Override public AuthorizablesConfig getGroupConfigurationBeans(final Collection yamlList, final AuthorizableValidator authorizableValidator) throws AcConfigBeanValidationException { final List<LinkedHashMap> authorizableList = (List<LinkedHashMap>) getConfigSection(Constants.GROUP_CONFIGURATION_KEY, yamlList); if (authorizableList == null) { LOG.debug("Group configuration not found in this YAML configuration file"); return null; } AuthorizablesConfig authorizableBeans = getAuthorizableBeans(authorizableList, authorizableValidator, true); return authorizableBeans; }  @Override @SuppressWarnings("rawtypes") AcesConfig getAceConfigurationBeans(final Collection<?> aceConfigData,
            final AceBeanValidator aceBeanValidator, Session session, String sourceFile); @Override AuthorizablesConfig getGroupConfigurationBeans(final Collection yamlList,
            final AuthorizableValidator authorizableValidator); @Override AuthorizablesConfig getUserConfigurationBeans(final Collection yamlList,
            final AuthorizableValidator authorizableValidator); @Override GlobalConfiguration getGlobalConfiguration(final Collection yamlList); @Override Set<String> getObsoluteAuthorizables(final Collection yamlList); static String[] parseActionsString(final String actionsStringFromConfig);  }