OpenSecurityProvider implements SecurityProvider { @NotNull @Override public <T> T getConfiguration(@NotNull Class<T> configClass) { if (AuthenticationConfiguration.class == configClass) { return (T) new OpenAuthenticationConfiguration(); } else if (AuthorizationConfiguration.class == configClass) { return (T) new OpenAuthorizationConfiguration(); } else { throw new IllegalArgumentException("Unsupported security configuration class " + configClass); } }  @NotNull @Override ConfigurationParameters getParameters(@Nullable String name); @NotNull @Override Iterable<? extends SecurityConfiguration> getConfigurations(); @NotNull @Override T getConfiguration(@NotNull Class<T> configClass);  }
@Test public void testGetAuthorizationConfiguration() { assertTrue(securityProvider.getConfiguration(AuthorizationConfiguration.class) instanceof OpenAuthorizationConfiguration); }
@Test public void testGetAuthenticationConfiguration() { assertTrue(securityProvider.getConfiguration(AuthenticationConfiguration.class) instanceof OpenAuthenticationConfiguration); }
@Test(expected = IllegalArgumentException.class) public void testGetUserConfiguration() { securityProvider.getConfiguration(UserConfiguration.class); }
@Test(expected = IllegalArgumentException.class) public void testGetPrincipalConfiguration() { securityProvider.getConfiguration(PrincipalConfiguration.class); }