UserService { public User findOne(Integer userId) { User user = userRepository.findOne(userId); 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 testValidFindOne(){ assertEquals(user, userService.findOne(user.getId())); }
@Test public void testInValidFindOne(){ assertEquals(null, userService.findOne(user2.getId())); }