Added extra calls to exercise CachingUserDetailsService

This commit is contained in:
Luke Taylor 2008-12-01 15:49:13 +00:00
parent a2f7b7e4f1
commit e3dd12021b
1 changed files with 24 additions and 22 deletions

View File

@ -44,7 +44,7 @@ public class JdbcUserServiceBeanDefinitionParserTests {
public void validUsernameIsFound() {
setContext("<jdbc-user-service data-source-ref='dataSource'/>" + DATA_SOURCE);
JdbcUserDetailsManager mgr = (JdbcUserDetailsManager) appContext.getBean(BeanIds.USER_DETAILS_SERVICE);
assertTrue(mgr.loadUserByUsername("rod") != null);
assertNotNull(mgr.loadUserByUsername("rod"));
}
@Test
@ -84,6 +84,8 @@ public class JdbcUserServiceBeanDefinitionParserTests {
CachingUserDetailsService cachingUserService =
(CachingUserDetailsService) appContext.getBean("myUserService" + AbstractUserDetailsServiceBeanDefinitionParser.CACHING_SUFFIX);
assertSame(cachingUserService.getUserCache(), appContext.getBean("userCache"));
assertNotNull(cachingUserService.loadUserByUsername("rod"));
assertNotNull(cachingUserService.loadUserByUsername("rod"));
}
@Test