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