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