@Test @Rollback(false) @Transactional public void testUpdateWithoutPassword() { User user = userService.findOne("admin"); userService.updateWithoutPassword(user.getUsername(), user); }
@Transactional @Override public User updateWithoutPassword(String username, User updatedUser) { Assert.notNull(updatedUser, "user must not be null"); Assert.notNull(updatedUser.getPassword(), "(old) password must not be null"); preUpdate(username, updatedUser); return doUpdate(username, updatedUser); }
UserServiceImpl implements UserService { @Transactional @Override public User updateWithoutPassword(String username, User updatedUser) { Assert.notNull(updatedUser, "user must not be null"); Assert.notNull(updatedUser.getPassword(), "(old) password must not be null"); preUpdate(username, updatedUser); return doUpdate(username, updatedUser); } }
UserServiceImpl implements UserService { @Transactional @Override public User updateWithoutPassword(String username, User updatedUser) { Assert.notNull(updatedUser, "user must not be null"); Assert.notNull(updatedUser.getPassword(), "(old) password must not be null"); preUpdate(username, updatedUser); return doUpdate(username, updatedUser); }  }
UserServiceImpl implements UserService { @Transactional @Override public User updateWithoutPassword(String username, User updatedUser) { Assert.notNull(updatedUser, "user must not be null"); Assert.notNull(updatedUser.getPassword(), "(old) password must not be null"); preUpdate(username, updatedUser); 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 updateWithoutPassword(String username, User updatedUser) { Assert.notNull(updatedUser, "user must not be null"); Assert.notNull(updatedUser.getPassword(), "(old) password must not be null"); preUpdate(username, updatedUser); 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);  }