JpaUserCredentialsDao extends JpaAbstractDao<UserCredentialsEntity, UserCredentials> implements UserCredentialsDao { @Override public UserCredentials findByResetToken(String resetToken) { return DaoUtil.getData(userCredentialsRepository.findByResetToken(resetToken)); }  @Override UserCredentials findByUserId(UUID userId); @Override UserCredentials findByActivateToken(String activateToken); @Override UserCredentials findByResetToken(String resetToken);  }
@Test @DatabaseSetup("classpath:dbunit/user_credentials.xml") public void testFindByResetToken() { UserCredentials userCredentials = userCredentialsDao.findByResetToken("RESET_TOKEN_2"); assertNotNull(userCredentials); assertEquals("4b9e010c-27d5-11e7-93ae-92361f002671", userCredentials.getId().toString()); }