use of com.thoughtworks.go.config.PasswordFileConfig in project gocd by gocd.
the class FileAuthenticationProviderTest method shouldNotEngageWhenPasswordFileIsNotConfigured.
@Test
public void shouldNotEngageWhenPasswordFileIsNotConfigured() throws Exception {
FileAuthenticationProvider provider = new FileAuthenticationProvider(goConfigService, null, userService, securityService);
when(goConfigService.security()).thenReturn(new SecurityConfig(null, new PasswordFileConfig(), true));
assertThat(provider.supports(UsernamePasswordAuthenticationToken.class), is(false));
}
use of com.thoughtworks.go.config.PasswordFileConfig in project gocd by gocd.
the class LdapConfigChangedListenerTest method shouldTriggerReintializeOfContextFactoryOnChangeOnLdapConfig.
@Test
public void shouldTriggerReintializeOfContextFactoryOnChangeOnLdapConfig() {
LdapConfig oldLdapConfig = new LdapConfig("oldOne", "manager", "pwd", null, true, new BasesConfig(new BaseConfig("foo")), "bar");
LdapConfig newLdapConfig = new LdapConfig("newOne", "manager", "pwd", null, true, new BasesConfig(new BaseConfig("foo")), "bar");
helper.addLdapSecurityWith(oldLdapConfig, true, new PasswordFileConfig(), new AdminsConfig());
LdapContextFactory mockContextFactory = mock(LdapContextFactory.class);
LdapConfigChangedListener listener = new LdapConfigChangedListener(oldLdapConfig, mockContextFactory);
helper.addLdapSecurityWith(newLdapConfig, true, new PasswordFileConfig(), new AdminsConfig());
listener.onConfigChange(helper.currentConfig());
verify(mockContextFactory, times(1)).initializeDelegator();
}
Aggregations