use of org.springframework.security.core.userdetails.UserDetailsService in project Activiti by Activiti.
the class SecurityAutoConfigurationTest method userDetailsService.
@Test
public void userDetailsService() throws Throwable {
this.applicationContext = new AnnotationConfigApplicationContext();
this.applicationContext.register(SecurityConfiguration.class);
this.applicationContext.refresh();
UserDetailsService userDetailsService = this.applicationContext.getBean(UserDetailsService.class);
Assert.assertNotNull("the userDetailsService should not be null", userDetailsService);
Assert.assertEquals("there should only be 1 authority", 1, userDetailsService.loadUserByUsername("jlong").getAuthorities().size());
Assert.assertEquals("there should be 2 authorities", 2, userDetailsService.loadUserByUsername("jbarrez").getAuthorities().size());
}
Aggregations