ConfigurationUtil { public static Configuration getJackrabbit2Configuration(final ConfigurationParameters loginConfiguration) { return new Configuration() { @Override public AppConfigurationEntry[] getAppConfigurationEntry(String applicationName) { Map<String, ?> options = loginConfiguration.getConfigValue(applicationName, Collections.<String, Object>emptyMap()); return new AppConfigurationEntry[]{ new GuestEntry(options), new TokenEntry(options), new DefaultEntry(options)}; } }; } private  ConfigurationUtil(); static Configuration getDefaultConfiguration(final ConfigurationParameters loginConfiguration); static Configuration getJackrabbit2Configuration(final ConfigurationParameters loginConfiguration);  }
@Test public void testGetJr2Configuration() { Configuration c = ConfigurationUtil.getJackrabbit2Configuration(ConfigurationParameters.EMPTY); AppConfigurationEntry[] entries = c.getAppConfigurationEntry("any"); assertEquals(3, entries.length); assertEquals(GuestLoginModule.class.getName(), entries[0].getLoginModuleName()); assertEquals(AppConfigurationEntry.LoginModuleControlFlag.OPTIONAL, entries[0].getControlFlag()); assertEquals("org.apache.jackrabbit.oak.security.authentication.token.TokenLoginModule", entries[1].getLoginModuleName()); assertEquals(AppConfigurationEntry.LoginModuleControlFlag.SUFFICIENT, entries[1].getControlFlag()); assertEquals("org.apache.jackrabbit.oak.security.authentication.user.LoginModuleImpl", entries[2].getLoginModuleName()); }