JpaDeviceCredentialsDao extends JpaAbstractDao<DeviceCredentialsEntity, DeviceCredentials> implements DeviceCredentialsDao { @Override public DeviceCredentials findByCredentialsId(String credentialsId) { return DaoUtil.getData(deviceCredentialsRepository.findByCredentialsId(credentialsId)); }  @Override DeviceCredentials findByDeviceId(UUID deviceId); @Override DeviceCredentials findByCredentialsId(String credentialsId);  }
@Test @DatabaseSetup("classpath:dbunit/device_credentials.xml") public void findByCredentialsId() { String credentialsId = "ID_2"; DeviceCredentials deviceCredentials = deviceCredentialsDao.findByCredentialsId(credentialsId); assertNotNull(deviceCredentials); assertEquals("958e3c74-3215-11e7-93ae-92361f002671", deviceCredentials.getId().getId().toString()); }