Search in sources :

Example 1 with NullUserCache

use of org.springframework.security.core.userdetails.cache.NullUserCache in project spring-security by spring-projects.

the class DigestAuthenticationFilterTests method testGettersSetters.

@Test
public void testGettersSetters() {
    DigestAuthenticationFilter filter = new DigestAuthenticationFilter();
    filter.setUserDetailsService(mock(UserDetailsService.class));
    assertThat(filter.getUserDetailsService() != null).isTrue();
    filter.setAuthenticationEntryPoint(new DigestAuthenticationEntryPoint());
    assertThat(filter.getAuthenticationEntryPoint() != null).isTrue();
    filter.setUserCache(null);
    assertThat(filter.getUserCache()).isNull();
    filter.setUserCache(new NullUserCache());
    assertThat(filter.getUserCache()).isNotNull();
}
Also used : UserDetailsService(org.springframework.security.core.userdetails.UserDetailsService) NullUserCache(org.springframework.security.core.userdetails.cache.NullUserCache) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)1 UserDetailsService (org.springframework.security.core.userdetails.UserDetailsService)1 NullUserCache (org.springframework.security.core.userdetails.cache.NullUserCache)1