@Ignore("TODO fix") @Test @Rollback(false) @Transactional public void testUpdate() { System.out.println("test update"); User user = new User("testuser", null, "testuser@example.com", true, false, "Test", "User", new HashSet<Role>()).lock().disable(); user.getRoles().clear(); user.getRoles().add(new Role(1)); System.out.println("lock"); user.setEmail("testuser2@example.com"); userService.update("testuser", user, "password"); }
@Transactional @Override public User update(String username, User updatedUser, String updatedRawPassword) { Assert.notNull(updatedUser, "user must not be null"); preUpdate(username, updatedUser); String encodedPassword = passwordEncoder.encode(updatedRawPassword); updatedUser.setPassword(encodedPassword); return doUpdate(username, updatedUser); }
UserServiceImpl implements UserService { @Transactional @Override public User update(String username, User updatedUser, String updatedRawPassword) { Assert.notNull(updatedUser, "user must not be null"); preUpdate(username, updatedUser); String encodedPassword = passwordEncoder.encode(updatedRawPassword); updatedUser.setPassword(encodedPassword); return doUpdate(username, updatedUser); } }
UserServiceImpl implements UserService { @Transactional @Override public User update(String username, User updatedUser, String updatedRawPassword) { Assert.notNull(updatedUser, "user must not be null"); preUpdate(username, updatedUser); String encodedPassword = passwordEncoder.encode(updatedRawPassword); updatedUser.setPassword(encodedPassword); return doUpdate(username, updatedUser); }  }
UserServiceImpl implements UserService { @Transactional @Override public User update(String username, User updatedUser, String updatedRawPassword) { Assert.notNull(updatedUser, "user must not be null"); preUpdate(username, updatedUser); String encodedPassword = passwordEncoder.encode(updatedRawPassword); updatedUser.setPassword(encodedPassword); return doUpdate(username, updatedUser); }  @Override User findOne(String username); @Override User findOneByUsernameOrEmail(String usernameOrEmail); @Override Page<User> findPage(Pageable pageable); @Transactional @Override User create(User user, String rawPassword); @Transactional @Override User update(String username, User updatedUser,
                       String updatedRawPassword); @Transactional @Override User updateWithoutPassword(String username, User updatedUser); @Transactional @Override void delete(String username); }
UserServiceImpl implements UserService { @Transactional @Override public User update(String username, User updatedUser, String updatedRawPassword) { Assert.notNull(updatedUser, "user must not be null"); preUpdate(username, updatedUser); String encodedPassword = passwordEncoder.encode(updatedRawPassword); updatedUser.setPassword(encodedPassword); return doUpdate(username, updatedUser); }  @Override User findOne(String username); @Override User findOneByUsernameOrEmail(String usernameOrEmail); @Override Page<User> findPage(Pageable pageable); @Transactional @Override User create(User user, String rawPassword); @Transactional @Override User update(String username, User updatedUser,
                       String updatedRawPassword); @Transactional @Override User updateWithoutPassword(String username, User updatedUser); @Transactional @Override void delete(String username);  }