UserServiceImpl implements UserService { @Transactional(readOnly = true) @Override public User findByEmail(String email) { return userRepository.findByEmail(email); }  @Override void save(User user); @Override void save(User user, int[] appIds); @Override void update(User user); @Override void updatePassword(int id, String oldPassword, String newPassword); @Override void update(User user, int[] appIds); @Override void deleteById(int id); @Transactional(readOnly = true) @Override User findById(int id); @Transactional(readOnly = true) @Override User findByEmail(String email); @Transactional(readOnly = true) @Override int[] findUserAppIds(int id); @Override List<User> findOrdinaryUsers(); @Transactional(readOnly = true) @Override List<User> findAll(); @Transactional(readOnly = true) @Override User authenticate(String email, String password);  }
@Test(dataProvider = "dataUser") public void testFindByEmail(User user) throws Exception { userService.save(user); user = userService.findByEmail(user.getEmail()); assertNotNull(user); }