use of org.baeldung.methodsecurity.entity.CustomUser in project tutorials by eugenp.
the class TestWithUserDetails method whenJohn_callLoadUserDetail_thenOK.
@Test
@WithUserDetails(value = "john", userDetailsServiceBeanName = "userDetailService")
public void whenJohn_callLoadUserDetail_thenOK() {
CustomUser user = userService.loadUserDetail("jane");
assertEquals("jane", user.getNickName());
}
use of org.baeldung.methodsecurity.entity.CustomUser in project tutorials by eugenp.
the class TestWithUserDetails method givenJane_callSecuredLoadUserDetailWithJane_thenOK.
@Test
@WithUserDetails(value = "jane", userDetailsServiceBeanName = "userDetailService")
public void givenJane_callSecuredLoadUserDetailWithJane_thenOK() {
CustomUser user = userService.securedLoadUserDetail("jane");
assertEquals("jane", user.getNickName());
assertEquals("jane", user.getUsername());
}
Aggregations