use of com.epam.ta.reportportal.ws.model.integration.auth.ActiveDirectoryResource in project service-authorization by reportportal.
the class GetActiveDirectoryStrategy method getIntegration.
@Override
public ActiveDirectoryResource getIntegration() {
IntegrationType adIntegrationType = integrationTypeRepository.findByName(AuthIntegrationType.ACTIVE_DIRECTORY.getName()).orElseThrow(() -> new ReportPortalException(ErrorType.AUTH_INTEGRATION_NOT_FOUND, AuthIntegrationType.ACTIVE_DIRECTORY.getName()));
// or else empty integration with default 'enabled = false' flag
ActiveDirectoryResource adResource = ActiveDirectoryConverter.TO_RESOURCE.apply(integrationRepository.findByNameAndTypeIdAndProjectIdIsNull(AuthIntegrationType.ACTIVE_DIRECTORY.getName(), adIntegrationType.getId()).orElseGet(Integration::new));
adResource.setType(adIntegrationType.getName());
return adResource;
}
Aggregations