@Test public void testFindByUsername() { User u = new User(USERNAME, PASS, SALT, ROLE); when(userRepository.findByUsername(USERNAME)).thenReturn(u); assertEquals(u, userService.findByUsername(USERNAME)); }
public User findByUsername(String username) { return userRepository.findByUsername(username); }
UserService { public User findByUsername(String username) { return userRepository.findByUsername(username); } }
UserService { public User findByUsername(String username) { return userRepository.findByUsername(username); }  }
UserService { public User findByUsername(String username) { return userRepository.findByUsername(username); }  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 User findByUsername(String username) { return userRepository.findByUsername(username); }  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);  }