}
@Test
public void setAuthenticatedUser_validRole() {
final User authUser = new UserImpl(USER_ID);
final Authority userRole = new AuthorityImpl();
userRole.setAuthority("admin");
authUser.addAuthority(userRole);
expect(userRepository.get(USER_ID)).andReturn(authUser).anyTimes();
replay(userRepository);
service.setAuthenticatedUser(USER_ID);