InternalSecurityProvider implements SecurityProvider, WhiteboardAware { @NotNull @Override @SuppressWarnings("unchecked") public <T> T getConfiguration(@NotNull Class<T> configurationClass) { if (configurationClass == AuthenticationConfiguration.class) { return (T) authenticationConfiguration; } if (configurationClass == AuthorizationConfiguration.class) { return (T) authorizationConfiguration; } if (configurationClass == UserConfiguration.class) { return (T) userConfiguration; } if (configurationClass == PrivilegeConfiguration.class) { return (T) privilegeConfiguration; } if (configurationClass == PrincipalConfiguration.class) { return (T) principalConfiguration; } if (configurationClass == TokenConfiguration.class) { return (T) tokenConfiguration; } throw new IllegalArgumentException("Unsupported security configuration class " + configurationClass); }  @NotNull @Override ConfigurationParameters getParameters(@Nullable String name); @NotNull @Override Iterable<? extends SecurityConfiguration> getConfigurations(); @NotNull @Override @SuppressWarnings("unchecked") T getConfiguration(@NotNull Class<T> configurationClass); @Override void setWhiteboard(@NotNull Whiteboard whiteboard); @Override Whiteboard getWhiteboard(); void setAuthenticationConfiguration(AuthenticationConfiguration authenticationConfiguration); void setAuthorizationConfiguration(AuthorizationConfiguration authorizationConfiguration); void setUserConfiguration(UserConfiguration userConfiguration); void setPrivilegeConfiguration(PrivilegeConfiguration privilegeConfiguration); void setPrincipalConfiguration(PrincipalConfiguration principalConfiguration); void setTokenConfiguration(TokenConfiguration tokenConfiguration);  }
@Test public void testDefaultPrincipalConfiguration() { PrincipalConfiguration defaultConfig = securityProvider.getConfiguration(PrincipalConfiguration.class); assertNull(defaultConfig); }
@Test public void testDefaultUserConfiguration() { assertNull(securityProvider.getConfiguration(UserConfiguration.class)); }
@Test public void testDefaultAuthenticationConfiguration() { assertNull(securityProvider.getConfiguration(AuthenticationConfiguration.class)); }
@Test public void testDefaultAuthorizationConfiguration() { assertNull(securityProvider.getConfiguration(AuthorizationConfiguration.class)); }
@Test public void testDefaultPrivilegeConfiguration() { assertNull(securityProvider.getConfiguration(PrivilegeConfiguration.class)); }
@Test public void testDefaultTokenConfiguration() { assertNull(securityProvider.getConfiguration(TokenConfiguration.class)); }
@Test(expected = IllegalArgumentException.class) public void testGetUnknownConfiguration() { securityProvider.getConfiguration(SecurityConfiguration.class); }