Search in sources :

Example 1 with Integration

use of com.epam.ta.reportportal.entity.integration.Integration 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()));
}
Also used : Integration(com.epam.ta.reportportal.entity.integration.Integration) IntegrationType(com.epam.ta.reportportal.entity.integration.IntegrationType) BaseTest(com.epam.ta.reportportal.BaseTest) Test(org.junit.jupiter.api.Test)

Example 2 with Integration

use of com.epam.ta.reportportal.entity.integration.Integration in project commons-dao by reportportal.

the class IntegrationRepositoryTest method shouldUpdateEnabledStateByIntegrationId.

@Test
void shouldUpdateEnabledStateByIntegrationId() {
    integrationRepository.updateEnabledStateById(true, RALLY_INTEGRATION_ID);
    Integration after = integrationRepository.findById(RALLY_INTEGRATION_ID).get();
    assertTrue(after.isEnabled());
}
Also used : Integration(com.epam.ta.reportportal.entity.integration.Integration) BaseTest(com.epam.ta.reportportal.BaseTest) Test(org.junit.jupiter.api.Test)

Example 3 with Integration

use of com.epam.ta.reportportal.entity.integration.Integration in project commons-dao by reportportal.

the class IntegrationRepositoryTest method findByIdAndTypeId.

@Test
void findByIdAndTypeId() {
    final Integration jiraIntegration = integrationRepository.findByIdAndTypeIdAndProjectIdIsNull(JIRA_INTEGRATION_ID, JIRA_INTEGRATION_TYPE_ID).get();
    assertEquals("jira", jiraIntegration.getName());
    assertEquals(JIRA_INTEGRATION_ID, jiraIntegration.getId());
    assertEquals(JIRA_INTEGRATION_TYPE_ID, jiraIntegration.getType().getId());
}
Also used : Integration(com.epam.ta.reportportal.entity.integration.Integration) BaseTest(com.epam.ta.reportportal.BaseTest) Test(org.junit.jupiter.api.Test)

Example 4 with Integration

use of com.epam.ta.reportportal.entity.integration.Integration 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);
}
Also used : Integration(com.epam.ta.reportportal.entity.integration.Integration) AuthIntegrationStrategy(com.epam.reportportal.auth.integration.handler.impl.strategy.AuthIntegrationStrategy) AuthIntegrationType(com.epam.reportportal.auth.integration.AuthIntegrationType) IntegrationType(com.epam.ta.reportportal.entity.integration.IntegrationType)

Example 5 with Integration

use of com.epam.ta.reportportal.entity.integration.Integration 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);
}
Also used : Integration(com.epam.ta.reportportal.entity.integration.Integration) AuthIntegrationStrategy(com.epam.reportportal.auth.integration.handler.impl.strategy.AuthIntegrationStrategy) AuthIntegrationType(com.epam.reportportal.auth.integration.AuthIntegrationType) IntegrationType(com.epam.ta.reportportal.entity.integration.IntegrationType)

Aggregations

Integration (com.epam.ta.reportportal.entity.integration.Integration)18 IntegrationType (com.epam.ta.reportportal.entity.integration.IntegrationType)8 BaseTest (com.epam.ta.reportportal.BaseTest)7 Test (org.junit.jupiter.api.Test)7 ReportPortalException (com.epam.ta.reportportal.exception.ReportPortalException)5 AuthIntegrationType (com.epam.reportportal.auth.integration.AuthIntegrationType)4 SamlProvidersReloadEvent (com.epam.reportportal.auth.event.SamlProvidersReloadEvent)2 AuthIntegrationStrategy (com.epam.reportportal.auth.integration.handler.impl.strategy.AuthIntegrationStrategy)2 Project (com.epam.ta.reportportal.entity.project.Project)2 BadCredentialsException (org.springframework.security.authentication.BadCredentialsException)2 AbstractUserReplicator (com.epam.reportportal.auth.integration.AbstractUserReplicator)1 AuthIntegrationBuilder (com.epam.reportportal.auth.integration.builder.AuthIntegrationBuilder)1 SamlParameter (com.epam.reportportal.auth.integration.parameter.SamlParameter)1 CROP_DOMAIN (com.epam.reportportal.auth.util.AuthUtils.CROP_DOMAIN)1 ContentTypeResolver (com.epam.reportportal.commons.ContentTypeResolver)1 UserBinaryDataService (com.epam.ta.reportportal.binary.UserBinaryDataService)1 IntegrationRepository (com.epam.ta.reportportal.dao.IntegrationRepository)1 IntegrationTypeRepository (com.epam.ta.reportportal.dao.IntegrationTypeRepository)1 ProjectRepository (com.epam.ta.reportportal.dao.ProjectRepository)1 UserRepository (com.epam.ta.reportportal.dao.UserRepository)1