UserService { public User createUser(User user) { user = userRepository.save(user); return user; } @Autowired  UserService(UserRepository userRepository);  UserService(); void setReviewRepository(UserRepository repository); User createUser(User user); User loginUser(User user); User findOne(Integer userId);  }
@Test public void testValidCreateUser(){ assertEquals(user, userService.createUser(user)); }
@Test public void testInvalidCreateUser(){ assertEquals(null, userService.createUser(user2)); }