Search in sources :

Example 11 with IntegrationType

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

the class IntegrationRepositoryTest method shouldDeleteAllGlobalByIntegrationTypeId.

@Test
void shouldDeleteAllGlobalByIntegrationTypeId() {
    IntegrationType integrationType = integrationTypeRepository.findById(JIRA_INTEGRATION_TYPE_ID).get();
    integrationRepository.deleteAllGlobalByIntegrationTypeId(integrationType.getId());
    assertThat(integrationRepository.findAllGlobalByType(integrationType), is(empty()));
    assertThat(integrationRepository.findAllByProjectIdAndType(DEFAULT_PERSONAL_PROJECT_ID, integrationType), is(not(empty())));
    assertThat(integrationRepository.findAllByProjectIdAndType(SUPERADMIN_PERSONAL_PROJECT_ID, integrationType), is(not(empty())));
}
Also used : IntegrationType(com.epam.ta.reportportal.entity.integration.IntegrationType) BaseTest(com.epam.ta.reportportal.BaseTest) Test(org.junit.jupiter.api.Test)

Example 12 with IntegrationType

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

the class IntegrationRepositoryTest method shouldUpdateEnabledStateByIntegrationTypeId.

@Test
void shouldUpdateEnabledStateByIntegrationTypeId() {
    IntegrationType integrationType = integrationTypeRepository.findById(JIRA_INTEGRATION_TYPE_ID).get();
    integrationRepository.updateEnabledStateByIntegrationTypeId(true, integrationType.getId());
    List<Integration> enabledAfter = integrationRepository.findAllByProjectIdAndType(DEFAULT_PERSONAL_PROJECT_ID, integrationType);
    enabledAfter.forEach(integration -> assertTrue(integration.isEnabled()));
}
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 13 with IntegrationType

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

the class IntegrationRepositoryTest method shouldDeleteAllByProjectIdAndIntegrationTypeId.

@Test
void shouldDeleteAllByProjectIdAndIntegrationTypeId() {
    IntegrationType integrationType = integrationTypeRepository.findById(JIRA_INTEGRATION_TYPE_ID).get();
    integrationRepository.deleteAllByProjectIdAndIntegrationTypeId(SUPERADMIN_PERSONAL_PROJECT_ID, integrationType.getId());
    assertThat(integrationRepository.findAllByProjectIdAndType(SUPERADMIN_PERSONAL_PROJECT_ID, integrationType), is(empty()));
    assertThat(integrationRepository.findAllByProjectIdAndType(DEFAULT_PERSONAL_PROJECT_ID, integrationType), is(not(empty())));
}
Also used : IntegrationType(com.epam.ta.reportportal.entity.integration.IntegrationType) BaseTest(com.epam.ta.reportportal.BaseTest) Test(org.junit.jupiter.api.Test)

Aggregations

IntegrationType (com.epam.ta.reportportal.entity.integration.IntegrationType)13 Integration (com.epam.ta.reportportal.entity.integration.Integration)8 AuthIntegrationType (com.epam.reportportal.auth.integration.AuthIntegrationType)6 BaseTest (com.epam.ta.reportportal.BaseTest)5 Test (org.junit.jupiter.api.Test)5 ReportPortalException (com.epam.ta.reportportal.exception.ReportPortalException)4 AuthIntegrationStrategy (com.epam.reportportal.auth.integration.handler.impl.strategy.AuthIntegrationStrategy)2 AbstractUserReplicator (com.epam.reportportal.auth.integration.AbstractUserReplicator)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 IntegrationTypeDetails (com.epam.ta.reportportal.entity.integration.IntegrationTypeDetails)1 Project (com.epam.ta.reportportal.entity.project.Project)1 User (com.epam.ta.reportportal.entity.user.User)1 UserRole (com.epam.ta.reportportal.entity.user.UserRole)1