Search in sources :

Example 6 with SysProvisioningOperationFilter

use of eu.bcvsolutions.idm.acc.dto.filter.SysProvisioningOperationFilter in project CzechIdMng by bcvsolutions.

the class SysProvisioningOperationFilterIntegrationTest method entityIdentifierFilterTest.

@Test
public void entityIdentifierFilterTest() {
    IdmBasePermission permission = IdmBasePermission.ADMIN;
    SystemEntityType entityType = SystemEntityType.IDENTITY;
    SysSystemDto system = createSystem();
    createProvisioningOperation(entityType, system);
    SysProvisioningOperationDto provisioningOperation1 = createProvisioningOperation(entityType, system);
    provisioningOperation1.setEntityIdentifier(UUID.randomUUID());
    operationService.save(provisioningOperation1);
    SysProvisioningOperationDto provisioningOperation2 = createProvisioningOperation(entityType, system);
    SysProvisioningOperationFilter filter = new SysProvisioningOperationFilter();
    filter.setEntityIdentifier(provisioningOperation1.getEntityIdentifier());
    filter.setSystemId(system.getId());
    Page<SysProvisioningOperationDto> result = operationService.find(filter, null, permission);
    assertEquals(1, result.getTotalElements());
    assertTrue(result.getContent().contains(provisioningOperation1));
    assertFalse(result.getContent().contains(provisioningOperation2));
}
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 7 with SysProvisioningOperationFilter

use of eu.bcvsolutions.idm.acc.dto.filter.SysProvisioningOperationFilter in project CzechIdMng by bcvsolutions.

the class SysProvisioningOperationFilterIntegrationTest method resultStateFilterTest.

@Test
public void resultStateFilterTest() {
    IdmBasePermission permission = IdmBasePermission.ADMIN;
    SystemEntityType entityType = SystemEntityType.IDENTITY;
    SysSystemDto system = createSystem();
    OperationResult resultState = new OperationResult();
    resultState.setState(OperationState.CREATED);
    SysProvisioningOperationDto provisioningOperation1 = createProvisioningOperation(entityType, system);
    SysProvisioningOperationDto provisioningOperation2 = createProvisioningOperation(entityType, system);
    provisioningOperation2.setResult(resultState);
    operationService.save(provisioningOperation2);
    SysProvisioningOperationFilter filter = new SysProvisioningOperationFilter();
    filter.setResultState(OperationState.CREATED);
    filter.setSystemId(system.getId());
    Page<SysProvisioningOperationDto> result = operationService.find(filter, null, permission);
    assertEquals(1, 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) OperationResult(eu.bcvsolutions.idm.core.api.entity.OperationResult) 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 8 with SysProvisioningOperationFilter

use of eu.bcvsolutions.idm.acc.dto.filter.SysProvisioningOperationFilter in project CzechIdMng by bcvsolutions.

the class SysProvisioningOperationFilterIntegrationTest method operationTypeFilterTest.

@Test
public void operationTypeFilterTest() {
    IdmBasePermission permission = IdmBasePermission.ADMIN;
    SystemEntityType entityType = SystemEntityType.IDENTITY;
    SysSystemDto system = createSystem();
    SysProvisioningOperationDto provisioningOperation1 = createProvisioningOperation(entityType, system);
    SysProvisioningOperationDto provisioningOperation2 = createProvisioningOperation(entityType, system);
    provisioningOperation2.setOperationType(ProvisioningEventType.CANCEL);
    operationService.save(provisioningOperation2);
    SysProvisioningOperationDto provisioningOperation3 = createProvisioningOperation(entityType, system);
    provisioningOperation3.setOperationType(ProvisioningEventType.CANCEL);
    operationService.save(provisioningOperation3);
    SysProvisioningOperationFilter filter = new SysProvisioningOperationFilter();
    filter.setSystemId(system.getId());
    filter.setOperationType(ProvisioningEventType.CANCEL);
    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 9 with SysProvisioningOperationFilter

use of eu.bcvsolutions.idm.acc.dto.filter.SysProvisioningOperationFilter in project CzechIdMng by bcvsolutions.

the class ContractGuaranteeSaveAndDeleteProcessorTest method testDeleteContractGuaranteeWithoutProvisioning.

@Test
public void testDeleteContractGuaranteeWithoutProvisioning() {
    IdmIdentityDto identity = testHelper.createIdentity();
    // 
    IdmIdentityDto guarantee = testHelper.createIdentity();
    IdmIdentityContractDto primeContract = testHelper.getPrimeContract(identity.getId());
    IdmContractGuaranteeDto contractGuarantee = testHelper.createContractGuarantee(primeContract.getId(), guarantee.getId());
    // delete
    contractGuaranteeService.delete(contractGuarantee);
    // 
    SysProvisioningOperationFilter filter = new SysProvisioningOperationFilter();
    filter.setEntityIdentifier(identity.getId());
    List<SysProvisioningArchiveDto> content = provisioningArchiveService.find(filter, null).getContent();
    assertEquals(0, content.size());
}
Also used : IdmContractGuaranteeDto(eu.bcvsolutions.idm.core.api.dto.IdmContractGuaranteeDto) SysProvisioningOperationFilter(eu.bcvsolutions.idm.acc.dto.filter.SysProvisioningOperationFilter) SysProvisioningArchiveDto(eu.bcvsolutions.idm.acc.dto.SysProvisioningArchiveDto) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) IdmIdentityContractDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto) Test(org.junit.Test) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)

Example 10 with SysProvisioningOperationFilter

use of eu.bcvsolutions.idm.acc.dto.filter.SysProvisioningOperationFilter in project CzechIdMng by bcvsolutions.

the class ContractGuaranteeSaveAndDeleteProcessorTest method testProvisioningAfterDeleteContractGuarantee.

@Test
public void testProvisioningAfterDeleteContractGuarantee() {
    SysSystemDto system = testHelper.createTestResourceSystem(true);
    // 
    IdmIdentityDto identity = testHelper.createIdentity();
    testHelper.createIdentityAccount(system, identity);
    // 
    // save identity with account, invoke provisioning = create
    identity = identityService.save(identity);
    // 
    IdmIdentityDto guarantee = testHelper.createIdentity();
    IdmIdentityContractDto primeContract = testHelper.getPrimeContract(identity.getId());
    IdmContractGuaranteeDto contractGuarantee = testHelper.createContractGuarantee(primeContract.getId(), guarantee.getId());
    // delete
    contractGuaranteeService.delete(contractGuarantee);
    // 
    SysProvisioningOperationFilter filter = new SysProvisioningOperationFilter();
    filter.setSystemId(system.getId());
    List<SysProvisioningArchiveDto> content = provisioningArchiveService.find(filter, null).getContent();
    // create, add contract guarantee and delete = 3 operation
    assertEquals(3, content.size());
    SysProvisioningArchiveDto last = Iterables.getLast(content);
    assertEquals(ProvisioningEventType.UPDATE, last.getOperationType());
    assertEquals(SystemEntityType.IDENTITY, last.getEntityType());
    assertEquals(identity.getId(), last.getEntityIdentifier());
}
Also used : IdmContractGuaranteeDto(eu.bcvsolutions.idm.core.api.dto.IdmContractGuaranteeDto) SysProvisioningOperationFilter(eu.bcvsolutions.idm.acc.dto.filter.SysProvisioningOperationFilter) SysProvisioningArchiveDto(eu.bcvsolutions.idm.acc.dto.SysProvisioningArchiveDto) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) IdmIdentityContractDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) Test(org.junit.Test) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)

Aggregations

SysProvisioningOperationFilter (eu.bcvsolutions.idm.acc.dto.filter.SysProvisioningOperationFilter)32 SysSystemDto (eu.bcvsolutions.idm.acc.dto.SysSystemDto)27 AbstractIntegrationTest (eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)27 Test (org.junit.Test)27 SysProvisioningArchiveDto (eu.bcvsolutions.idm.acc.dto.SysProvisioningArchiveDto)15 SysProvisioningOperationDto (eu.bcvsolutions.idm.acc.dto.SysProvisioningOperationDto)15 IdmBasePermission (eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission)14 SystemEntityType (eu.bcvsolutions.idm.acc.domain.SystemEntityType)13 IdmIdentityDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto)8 ProvisioningAttributeDto (eu.bcvsolutions.idm.acc.dto.ProvisioningAttributeDto)7 IdmIdentityContractDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto)6 GuardedString (eu.bcvsolutions.idm.core.security.api.domain.GuardedString)6 IcConnectorObject (eu.bcvsolutions.idm.ic.api.IcConnectorObject)6 SysProvisioningBatchDto (eu.bcvsolutions.idm.acc.dto.SysProvisioningBatchDto)4 SysSystemEntityDto (eu.bcvsolutions.idm.acc.dto.SysSystemEntityDto)4 IdmContractGuaranteeDto (eu.bcvsolutions.idm.core.api.dto.IdmContractGuaranteeDto)4 OperationResult (eu.bcvsolutions.idm.core.api.entity.OperationResult)3 ProvisioningContext (eu.bcvsolutions.idm.acc.domain.ProvisioningContext)2 SysRoleSystemDto (eu.bcvsolutions.idm.acc.dto.SysRoleSystemDto)2 SysSchemaAttributeDto (eu.bcvsolutions.idm.acc.dto.SysSchemaAttributeDto)2