Search in sources :

Example 16 with IdmBasePermission

use of eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission in project CzechIdMng by bcvsolutions.

the class SysProvisioningOperationFilterIntegrationTest method systemEntityUidFilterTest.

@Test
public void systemEntityUidFilterTest() {
    IdmBasePermission permission = IdmBasePermission.ADMIN;
    SystemEntityType entityType = SystemEntityType.IDENTITY;
    SysSystemDto system = createSystem();
    SysProvisioningOperationDto provisioningOperation1 = createProvisioningOperation(entityType, system);
    SysProvisioningOperationDto provisioningOperation2 = createProvisioningOperation(entityType, system);
    SysProvisioningOperationDto provisioningOperation3 = createProvisioningOperation(entityType, system);
    SysProvisioningOperationFilter filter = new SysProvisioningOperationFilter();
    filter.setSystemId(system.getId());
    filter.setSystemEntityUid(provisioningOperation1.getSystemEntityUid());
    Page<SysProvisioningOperationDto> result = operationService.find(filter, null, permission);
    assertEquals(1, result.getTotalElements());
    assertTrue(result.getContent().contains(provisioningOperation1));
    assertFalse(result.getContent().contains(provisioningOperation2));
    assertFalse(result.getContent().contains(provisioningOperation3));
}
Also used : SysProvisioningOperationFilter(eu.bcvsolutions.idm.acc.dto.filter.SysProvisioningOperationFilter) IdmBasePermission(eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission) SystemEntityType(eu.bcvsolutions.idm.acc.domain.SystemEntityType) SysProvisioningOperationDto(eu.bcvsolutions.idm.acc.dto.SysProvisioningOperationDto) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Test(org.junit.Test)

Example 17 with IdmBasePermission

use of eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission in project CzechIdMng by bcvsolutions.

the class SysProvisioningOperationFilterIntegrationTest method dateTimeFilterTest.

@Test
public void dateTimeFilterTest() {
    IdmBasePermission permission = IdmBasePermission.ADMIN;
    SystemEntityType entityType = SystemEntityType.IDENTITY;
    SysSystemDto system = createSystem();
    createProvisioningOperation(entityType, system);
    helper.waitForResult(null, null, 1);
    DateTime dateTime = DateTime.now();
    SysProvisioningOperationDto provisioningOperation2 = createProvisioningOperation(entityType, system);
    SysProvisioningOperationFilter filter = new SysProvisioningOperationFilter();
    filter.setSystemId(system.getId());
    filter.setFrom(dateTime);
    Page<SysProvisioningOperationDto> result = operationService.find(filter, null, permission);
    assertEquals(1, result.getTotalElements());
    assertTrue(result.getContent().contains(provisioningOperation2));
    dateTime = dateTime.minusHours(1);
    SysProvisioningOperationFilter filter2 = new SysProvisioningOperationFilter();
    filter2.setSystemId(system.getId());
    filter2.setTill(dateTime);
    Page<SysProvisioningOperationDto> result2 = operationService.find(filter2, null, permission);
    assertEquals(0, result2.getTotalElements());
}
Also used : SysProvisioningOperationFilter(eu.bcvsolutions.idm.acc.dto.filter.SysProvisioningOperationFilter) IdmBasePermission(eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission) SystemEntityType(eu.bcvsolutions.idm.acc.domain.SystemEntityType) SysProvisioningOperationDto(eu.bcvsolutions.idm.acc.dto.SysProvisioningOperationDto) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) DateTime(org.joda.time.DateTime) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Test(org.junit.Test)

Example 18 with IdmBasePermission

use of eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission in project CzechIdMng by bcvsolutions.

the class SysProvisioningOperationFilterIntegrationTest method typeFilterTest.

@Test
public void typeFilterTest() {
    IdmBasePermission permission = IdmBasePermission.ADMIN;
    SysSystemDto system = createSystem();
    createProvisioningOperation(SystemEntityType.CONTRACT, system);
    SysProvisioningOperationDto provisioningOperation2 = createProvisioningOperation(SystemEntityType.IDENTITY, system);
    SysProvisioningOperationDto provisioningOperation3 = createProvisioningOperation(SystemEntityType.CONTRACT, system);
    SysProvisioningOperationFilter filter = new SysProvisioningOperationFilter();
    filter.setSystemId(system.getId());
    filter.setEntityType(SystemEntityType.CONTRACT);
    Page<SysProvisioningOperationDto> result = operationService.find(filter, null, permission);
    assertEquals(2, result.getTotalElements());
    assertTrue(result.getContent().contains(provisioningOperation3));
    assertFalse(result.getContent().contains(provisioningOperation2));
}
Also used : SysProvisioningOperationFilter(eu.bcvsolutions.idm.acc.dto.filter.SysProvisioningOperationFilter) IdmBasePermission(eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission) SysProvisioningOperationDto(eu.bcvsolutions.idm.acc.dto.SysProvisioningOperationDto) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Test(org.junit.Test)

Example 19 with IdmBasePermission

use of eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission in project CzechIdMng by bcvsolutions.

the class SysProvisioningOperationFilterIntegrationTest method systemIdFilterTest.

@Test
public void systemIdFilterTest() {
    IdmBasePermission permission = IdmBasePermission.ADMIN;
    SystemEntityType entityType = SystemEntityType.IDENTITY;
    SysSystemDto system2 = createSystem();
    SysSystemDto system1 = createSystem();
    createProvisioningOperation(entityType, system2);
    SysProvisioningOperationDto provisioningOperation1 = createProvisioningOperation(entityType, system1);
    SysProvisioningOperationDto provisioningOperation2 = createProvisioningOperation(entityType, system2);
    SysProvisioningOperationFilter filter = new SysProvisioningOperationFilter();
    filter.setSystemId(system2.getId());
    Page<SysProvisioningOperationDto> result = operationService.find(filter, null, permission);
    assertEquals(2, result.getTotalElements());
    assertTrue(result.getContent().contains(provisioningOperation2));
    assertFalse(result.getContent().contains(provisioningOperation1));
}
Also used : SysProvisioningOperationFilter(eu.bcvsolutions.idm.acc.dto.filter.SysProvisioningOperationFilter) IdmBasePermission(eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission) SystemEntityType(eu.bcvsolutions.idm.acc.domain.SystemEntityType) SysProvisioningOperationDto(eu.bcvsolutions.idm.acc.dto.SysProvisioningOperationDto) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Test(org.junit.Test)

Example 20 with IdmBasePermission

use of eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission in project CzechIdMng by bcvsolutions.

the class SysProvisioningOperationFilterIntegrationTest method batchIdFilterTest.

@Test
public void batchIdFilterTest() {
    IdmBasePermission permission = IdmBasePermission.ADMIN;
    SystemEntityType entityType = SystemEntityType.IDENTITY;
    SysSystemDto system = createSystem();
    SysProvisioningBatchDto provisioningBatch = new SysProvisioningBatchDto();
    provisioningBatch = batchService.save(provisioningBatch);
    SysProvisioningOperationDto provisioningOperation1 = createProvisioningOperation(entityType, system);
    provisioningOperation1.setBatch(provisioningBatch.getId());
    provisioningOperation1 = operationService.save(provisioningOperation1);
    SysProvisioningOperationDto provisioningOperation2 = createProvisioningOperation(entityType, system);
    provisioningOperation2.setBatch(provisioningBatch.getId());
    provisioningOperation2 = operationService.save(provisioningOperation2);
    SysProvisioningOperationDto provisioningOperation3 = createProvisioningOperation(entityType, system);
    SysProvisioningOperationFilter filter = new SysProvisioningOperationFilter();
    filter.setSystemId(system.getId());
    filter.setBatchId(provisioningBatch.getId());
    Page<SysProvisioningOperationDto> result = operationService.find(filter, null, permission);
    assertEquals(2, result.getTotalElements());
    assertTrue(result.getContent().contains(provisioningOperation1));
    assertTrue(result.getContent().contains(provisioningOperation2));
    assertFalse(result.getContent().contains(provisioningOperation3));
}
Also used : SysProvisioningOperationFilter(eu.bcvsolutions.idm.acc.dto.filter.SysProvisioningOperationFilter) IdmBasePermission(eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission) SystemEntityType(eu.bcvsolutions.idm.acc.domain.SystemEntityType) SysProvisioningBatchDto(eu.bcvsolutions.idm.acc.dto.SysProvisioningBatchDto) SysProvisioningOperationDto(eu.bcvsolutions.idm.acc.dto.SysProvisioningOperationDto) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Test(org.junit.Test)

Aggregations

IdmBasePermission (eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission)27 AbstractIntegrationTest (eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)27 Test (org.junit.Test)27 SysSystemDto (eu.bcvsolutions.idm.acc.dto.SysSystemDto)26 SystemEntityType (eu.bcvsolutions.idm.acc.domain.SystemEntityType)23 SysProvisioningOperationFilter (eu.bcvsolutions.idm.acc.dto.filter.SysProvisioningOperationFilter)14 SysSchemaObjectClassDto (eu.bcvsolutions.idm.acc.dto.SysSchemaObjectClassDto)12 SysSystemMappingDto (eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto)12 SysProvisioningOperationDto (eu.bcvsolutions.idm.acc.dto.SysProvisioningOperationDto)8 AttributeMappingStrategyType (eu.bcvsolutions.idm.acc.domain.AttributeMappingStrategyType)6 SysProvisioningArchiveDto (eu.bcvsolutions.idm.acc.dto.SysProvisioningArchiveDto)6 SysSchemaAttributeDto (eu.bcvsolutions.idm.acc.dto.SysSchemaAttributeDto)6 SysSystemAttributeMappingDto (eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto)6 SysSystemAttributeMappingFilter (eu.bcvsolutions.idm.acc.dto.filter.SysSystemAttributeMappingFilter)6 SysSystemMappingFilter (eu.bcvsolutions.idm.acc.dto.filter.SysSystemMappingFilter)6 SysProvisioningBatchDto (eu.bcvsolutions.idm.acc.dto.SysProvisioningBatchDto)2 OperationResult (eu.bcvsolutions.idm.core.api.entity.OperationResult)2 IdmTreeTypeDto (eu.bcvsolutions.idm.core.api.dto.IdmTreeTypeDto)1 EmptyFilter (eu.bcvsolutions.idm.core.api.dto.filter.EmptyFilter)1 DateTime (org.joda.time.DateTime)1