InternalSecurityProvider implements SecurityProvider, WhiteboardAware { public void setPrincipalConfiguration(PrincipalConfiguration principalConfiguration) { this.principalConfiguration = principalConfiguration; }  @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 testSetPrincipalConfiguration() { PrincipalConfiguration pc = Mockito.mock(PrincipalConfiguration.class); when(pc.getParameters()).thenReturn(PARAMS); securityProvider.setPrincipalConfiguration(pc); assertSame(pc, securityProvider.getConfiguration(PrincipalConfiguration.class)); for (SecurityConfiguration sc : securityProvider.getConfigurations()) { if (sc instanceof PrincipalConfiguration) { assertSame(pc, sc); } } assertTrue(Iterables.contains(securityProvider.getConfigurations(), pc)); assertEquals(PARAMS, securityProvider.getParameters(PrincipalConfiguration.NAME)); }