use of com.epam.ta.reportportal.entity.integration.IntegrationType in project commons-dao by reportportal.
the class IntegrationRepositoryTest method shouldFindAllGlobalByIntegrationType.
@Test
void shouldFindAllGlobalByIntegrationType() {
IntegrationType integrationType = integrationTypeRepository.findById(2L).get();
List<Integration> globalEmailIntegrations = integrationRepository.findAllGlobalByType(integrationType);
assertNotNull(globalEmailIntegrations);
assertEquals(GLOBAL_EMAIL_INTEGRATIONS_COUNT, globalEmailIntegrations.size());
globalEmailIntegrations.forEach(i -> assertNull(i.getProject()));
}
use of com.epam.ta.reportportal.entity.integration.IntegrationType in project service-authorization by reportportal.
the class CreateAuthIntegrationHandlerImpl method createAuthIntegration.
@Override
public AbstractAuthResource createAuthIntegration(AuthIntegrationType type, UpdateAuthRQ request, ReportPortalUser user) {
final IntegrationType integrationType = getIntegrationType(type);
final AuthIntegrationStrategy authIntegrationStrategy = getAuthStragegy(type);
final Integration integration = authIntegrationStrategy.createIntegration(integrationType, request, user.getUsername());
return type.getToResourceMapper().apply(integration);
}
use of com.epam.ta.reportportal.entity.integration.IntegrationType in project service-authorization by reportportal.
the class CreateAuthIntegrationHandlerImpl method updateAuthIntegration.
@Override
public AbstractAuthResource updateAuthIntegration(AuthIntegrationType type, Long integrationId, UpdateAuthRQ request, ReportPortalUser user) {
final IntegrationType integrationType = getIntegrationType(type);
final AuthIntegrationStrategy authIntegrationStrategy = getAuthStragegy(type);
final Integration integration = authIntegrationStrategy.updateIntegration(integrationType, integrationId, request);
return type.getToResourceMapper().apply(integration);
}
use of com.epam.ta.reportportal.entity.integration.IntegrationType 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;
}
use of com.epam.ta.reportportal.entity.integration.IntegrationType in project service-authorization by reportportal.
the class SamlProvidersReloadEventHandler method onApplicationEvent.
@Override
public void onApplicationEvent(SamlProvidersReloadEvent event) {
final IntegrationType integrationType = event.getIntegrationType();
final List<Integration> integrations = integrationRepository.findAllGlobalByType(integrationType);
LocalServiceProviderConfiguration serviceProvider = samlConfiguration.getServiceProvider();
serviceProvider.getProviders().clear();
serviceProvider.getProviders().addAll(SamlConverter.TO_EXTERNAL_PROVIDER_CONFIG.apply(integrations));
}
Aggregations