use of org.springframework.security.core.userdetails.cache.SpringCacheBasedUserCache in project spring-security by spring-projects.
the class DaoAuthenticationProviderTests method testGettersSetters.
@Test
public void testGettersSetters() {
DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setPasswordEncoder(new BCryptPasswordEncoder());
assertThat(provider.getPasswordEncoder().getClass()).isEqualTo(BCryptPasswordEncoder.class);
provider.setUserCache(new SpringCacheBasedUserCache(mock(Cache.class)));
assertThat(provider.getUserCache().getClass()).isEqualTo(SpringCacheBasedUserCache.class);
assertThat(provider.isForcePrincipalAsString()).isFalse();
provider.setForcePrincipalAsString(true);
assertThat(provider.isForcePrincipalAsString()).isTrue();
}
Aggregations