Search in sources :

Example 11 with SysSystemEntityDto

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

the class AbstractProvisioningExecutor method doDeleteProvisioning.

@Override
public void doDeleteProvisioning(AccAccountDto account, UUID entityId) {
    Assert.notNull(account, "Account is required.");
    SysSystemEntityDto systemEntity = getSystemEntity(account);
    // 
    if (systemEntity != null) {
        doProvisioning(systemEntity, null, entityId, ProvisioningOperationType.DELETE, null);
    }
}
Also used : SysSystemEntityDto(eu.bcvsolutions.idm.acc.dto.SysSystemEntityDto)

Example 12 with SysSystemEntityDto

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

the class DefaultSysSystemEntityServiceIntegrationTest method testReferentialIntegrity.

@Test
public void testReferentialIntegrity() {
    // system
    SysSystemDto system = new SysSystemDto();
    String systemName = "t_s_" + System.currentTimeMillis();
    system.setName(systemName);
    system = systemService.save(system);
    // system entity
    SysSystemEntityDto systemEntity = new SysSystemEntityDto();
    systemEntity.setSystem(system.getId());
    systemEntity.setEntityType(SystemEntityType.IDENTITY);
    String uid = "se_uid_" + System.currentTimeMillis();
    systemEntity.setUid(uid);
    systemEntity = systemEntityService.save(systemEntity);
    // account
    AccAccountDto account = new AccAccountDto();
    account.setSystem(system.getId());
    account.setUid("test_uid_" + System.currentTimeMillis());
    account.setAccountType(AccountType.PERSONAL);
    account.setSystemEntity(systemEntity.getId());
    account = accountService.save(account);
    SysSystemEntityDto systemEntityDto = DtoUtils.getEmbedded(account, AccAccount_.systemEntity);
    assertEquals(uid, systemEntityDto.getUid());
    systemEntityService.delete(systemEntity);
    assertNull(accountService.get(account.getId()).getSystemEntity());
}
Also used : AccAccountDto(eu.bcvsolutions.idm.acc.dto.AccAccountDto) SysSystemEntityDto(eu.bcvsolutions.idm.acc.dto.SysSystemEntityDto) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) Test(org.junit.Test) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)

Example 13 with SysSystemEntityDto

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

the class DefaultSysProvisioningBatchServiceTest method testMergeBatches.

@Test
public void testMergeBatches() {
    // create two batch for the same system entity
    SysSystemDto system = getHelper().createSystem(TestResource.TABLE_NAME);
    SysSystemEntityDto systemEntity = getHelper().createSystemEntity(system);
    // 
    SysProvisioningBatchDto batchOne = new SysProvisioningBatchDto();
    batchOne.setId(UUID.randomUUID());
    batchOne.setSystemEntity(systemEntity.getId());
    batchOne = batchService.save(batchOne);
    SysProvisioningOperationDto operationOne = createOperation(systemEntity, batchOne);
    // 
    SysProvisioningBatchDto batchTwo = new SysProvisioningBatchDto();
    batchTwo.setId(UUID.randomUUID());
    batchTwo.setSystemEntity(systemEntity.getId());
    batchTwo = batchService.save(batchTwo);
    SysProvisioningOperationDto operationTwo = createOperation(systemEntity, batchTwo);
    // 
    Assert.assertNotEquals(batchOne.getId(), batchTwo.getId());
    // 
    SysProvisioningBatchDto mergedBatch = batchService.findBatch(systemEntity.getId());
    // 
    Assert.assertEquals(batchOne.getId(), mergedBatch.getId());
    // 
    Assert.assertNull(batchService.get(batchTwo));
    operationOne = operationService.get(operationOne.getId());
    operationTwo = operationService.get(operationTwo.getId());
    Assert.assertEquals(batchOne.getId(), operationOne.getBatch());
    Assert.assertEquals(batchOne.getId(), operationTwo.getBatch());
}
Also used : SysProvisioningBatchDto(eu.bcvsolutions.idm.acc.dto.SysProvisioningBatchDto) SysSystemEntityDto(eu.bcvsolutions.idm.acc.dto.SysSystemEntityDto) SysProvisioningOperationDto(eu.bcvsolutions.idm.acc.dto.SysProvisioningOperationDto) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) Test(org.junit.Test) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)

Example 14 with SysSystemEntityDto

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

the class DefaultSysSystemServiceIntegrationTest method testReferentialIntegritySystemEntityExists.

@Test
public void testReferentialIntegritySystemEntityExists() {
    SysSystemDto system = new SysSystemDto();
    String systemName = "t_s_" + System.currentTimeMillis();
    system.setName(systemName);
    system = systemService.save(system);
    // system entity
    SysSystemEntityDto systemEntity = new SysSystemEntityDto();
    systemEntity.setSystem(system.getId());
    systemEntity.setEntityType(SystemEntityType.IDENTITY);
    systemEntity.setUid("se_uid_" + System.currentTimeMillis());
    systemEntity = systemEntityService.save(systemEntity);
    systemService.delete(system);
    assertNull(systemService.getByCode(system.getCode()));
    assertNull(systemEntityService.get(systemEntity.getId()));
}
Also used : GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString) SysSystemEntityDto(eu.bcvsolutions.idm.acc.dto.SysSystemEntityDto) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Test(org.junit.Test)

Example 15 with SysSystemEntityDto

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

the class DefaultSysSystemEntityServiceFilterTest method testFindByText.

@Test
public void testFindByText() {
    SysSystemDto system = helper.createTestResourceSystem(false);
    SysSystemEntityDto entityOne = createEntitySystem(getHelper().createName(), SystemEntityType.CONTRACT, system.getId(), UUID.randomUUID());
    createEntitySystem(getHelper().createName(), SystemEntityType.CONTRACT, system.getId(), UUID.randomUUID());
    createEntitySystem(getHelper().createName(), SystemEntityType.CONTRACT, system.getId(), UUID.randomUUID());
    // 
    SysSystemEntityFilter testFilter = new SysSystemEntityFilter();
    testFilter.setText(entityOne.getUid());
    List<SysSystemEntityDto> results = entityService.find(testFilter, null).getContent();
    Assert.assertEquals(1, results.size());
    Assert.assertEquals(entityOne.getId(), results.get(0).getId());
}
Also used : SysSystemEntityDto(eu.bcvsolutions.idm.acc.dto.SysSystemEntityDto) SysSystemEntityFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSystemEntityFilter) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) Test(org.junit.Test) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)

Aggregations

SysSystemEntityDto (eu.bcvsolutions.idm.acc.dto.SysSystemEntityDto)69 SysSystemDto (eu.bcvsolutions.idm.acc.dto.SysSystemDto)49 AbstractIntegrationTest (eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)36 Test (org.junit.Test)36 SysProvisioningOperationDto (eu.bcvsolutions.idm.acc.dto.SysProvisioningOperationDto)25 GuardedString (eu.bcvsolutions.idm.core.security.api.domain.GuardedString)22 IcConnectorObject (eu.bcvsolutions.idm.ic.api.IcConnectorObject)19 IdmIdentityDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto)15 AccAccountDto (eu.bcvsolutions.idm.acc.dto.AccAccountDto)14 ProvisioningAttributeDto (eu.bcvsolutions.idm.acc.dto.ProvisioningAttributeDto)14 ProvisioningContext (eu.bcvsolutions.idm.acc.domain.ProvisioningContext)13 SysSystemMappingDto (eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto)12 OperationResult (eu.bcvsolutions.idm.core.api.entity.OperationResult)12 SysProvisioningBatchDto (eu.bcvsolutions.idm.acc.dto.SysProvisioningBatchDto)11 SystemEntityType (eu.bcvsolutions.idm.acc.domain.SystemEntityType)10 ProvisioningException (eu.bcvsolutions.idm.acc.exception.ProvisioningException)10 IcObjectClass (eu.bcvsolutions.idm.ic.api.IcObjectClass)10 IcObjectClassImpl (eu.bcvsolutions.idm.ic.impl.IcObjectClassImpl)10 SysProvisioningOperationFilter (eu.bcvsolutions.idm.acc.dto.filter.SysProvisioningOperationFilter)8 SysSystemEntityFilter (eu.bcvsolutions.idm.acc.dto.filter.SysSystemEntityFilter)8