new UsernamePasswordAuthenticationToken(user1.getUsername(), user1.getPassword(), user1.getAuthorities());
token.setDetails(user1);
securityContext.setAuthentication(token);
SecurityContextHolder.setContext(securityContext);
UserManager userManager = makeInterceptedTarget();
final User user = new User("user");
user.setId(1L);
user.getRoles().add(new Role(Constants.ADMIN_ROLE));
user.getRoles().add(new Role(Constants.USER_ROLE));
given(userDao.saveUser(user)).willReturn(user);
given(passwordEncoder.encode(user.getPassword())).willReturn(user.getPassword());
userManager.saveUser(user);
}