@Test public void testCreate() { userService.create(USERNAME, PASS, ROLE); verify(userRepository).save(user); }
public void create(String username, String password, String role) { String salt = stringSupport.generate(); User u = userFactory.create(username, shaPasswordEncoder.encodePassword(password, salt), salt, role); userRepository.save(u); }
UserService { public void create(String username, String password, String role) { String salt = stringSupport.generate(); User u = userFactory.create(username, shaPasswordEncoder.encodePassword(password, salt), salt, role); userRepository.save(u); } }
UserService { public void create(String username, String password, String role) { String salt = stringSupport.generate(); User u = userFactory.create(username, shaPasswordEncoder.encodePassword(password, salt), salt, role); userRepository.save(u); }  }
UserService { public void create(String username, String password, String role) { String salt = stringSupport.generate(); User u = userFactory.create(username, shaPasswordEncoder.encodePassword(password, salt), salt, role); userRepository.save(u); }  void create(String username, String password, String role); User isLoginValid(String username, String pass); User findByUsername(String username); User createUserToken(String username, String secret); User validateUser(String token, String secret); }
UserService { public void create(String username, String password, String role) { String salt = stringSupport.generate(); User u = userFactory.create(username, shaPasswordEncoder.encodePassword(password, salt), salt, role); userRepository.save(u); }  void create(String username, String password, String role); User isLoginValid(String username, String pass); User findByUsername(String username); User createUserToken(String username, String secret); User validateUser(String token, String secret);  }