replay(userRepository);
service.setAuthenticatedUser(USER_ID);
assertThat((User) SecurityContextHolder.getContext().getAuthentication().getPrincipal(),
is(sameInstance(authUser)));
final GrantedAuthority grantedAuthority =
SecurityContextHolder.getContext().getAuthentication().getAuthorities().iterator().next();
assertEquals("has authority admin", "admin", grantedAuthority.getAuthority());
verify(userRepository);
}