Java 类org.springframework.security.core.userdetails.cache.NullUserCache 实例源码

项目:eHMP    文件:VistaAuthenticationProviderTest.java   
@Test
public void testStartupFailsIfNoUserCacheSet() throws Exception {
    VistaAuthenticationProvider provider = new VistaAuthenticationProvider();
    provider.setUserDetailsService(mockUserDetailService);
    assertEquals(NullUserCache.class, provider.getUserCache().getClass());
    provider.setUserCache(null);

    try {
        provider.afterPropertiesSet();
        fail("Should have thrown IllegalArgumentException");
    } catch (IllegalArgumentException expected) {
        assertTrue(true);
    }
}
项目:eMonocot    文件:UserServiceImpl.java   
public UserServiceImpl() {
    saltSource = new ReflectionSaltSource();
    ((ReflectionSaltSource) saltSource).setUserPropertyToUse("getUsername");
    passwordEncoder = new Md5PasswordEncoder();
    userCache = new NullUserCache();
}