Search in sources :

Example 11 with SysSystemAttributeMappingDto

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

the class DefaultSysSystemAttributeMappingServiceTest method systemIdFilterTest.

@Test
public void systemIdFilterTest() {
    IdmBasePermission permission = IdmBasePermission.ADMIN;
    SystemEntityType entityType = SystemEntityType.IDENTITY;
    AttributeMappingStrategyType strategyType = AttributeMappingStrategyType.MERGE;
    SysSystemDto system1 = createSystem();
    SysSystemDto system2 = createSystem();
    SysSchemaObjectClassDto objectClass1 = createObjectClass(system1);
    SysSchemaObjectClassDto objectClass2 = createObjectClass(system2);
    SysSystemMappingDto systemMapping1 = testHelper.createMappingSystem(entityType, objectClass1);
    SysSystemMappingDto systemMapping2 = testHelper.createMappingSystem(entityType, objectClass2);
    SysSchemaAttributeDto schemaAttribute1 = createSchemaAttribute(objectClass1);
    SysSchemaAttributeDto schemaAttribute2 = createSchemaAttribute(objectClass2);
    SysSystemAttributeMappingDto attributeMapping1 = createAttributeMappingSystem(systemMapping1, strategyType, schemaAttribute1.getId());
    SysSystemAttributeMappingDto attributeMapping2 = createAttributeMappingSystem(systemMapping2, strategyType, schemaAttribute2.getId());
    SysSystemAttributeMappingFilter filter = new SysSystemAttributeMappingFilter();
    filter.setSystemId(system1.getId());
    Page<SysSystemAttributeMappingDto> result = attributeMappingService.find(filter, null, permission);
    assertEquals(1, result.getTotalElements());
    assertTrue(result.getContent().contains(attributeMapping1));
    assertFalse(result.getContent().contains(attributeMapping2));
}
Also used : SysSystemAttributeMappingFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSystemAttributeMappingFilter) AttributeMappingStrategyType(eu.bcvsolutions.idm.acc.domain.AttributeMappingStrategyType) SysSchemaAttributeDto(eu.bcvsolutions.idm.acc.dto.SysSchemaAttributeDto) SysSystemAttributeMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto) IdmBasePermission(eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission) SystemEntityType(eu.bcvsolutions.idm.acc.domain.SystemEntityType) SysSystemMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto) SysSchemaObjectClassDto(eu.bcvsolutions.idm.acc.dto.SysSchemaObjectClassDto) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Test(org.junit.Test)

Example 12 with SysSystemAttributeMappingDto

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

the class DefaultSysSystemAttributeMappingServiceTest method schemaAttributeIdFilterTest.

@Test
public void schemaAttributeIdFilterTest() {
    IdmBasePermission permission = IdmBasePermission.ADMIN;
    SystemEntityType entityType = SystemEntityType.IDENTITY;
    AttributeMappingStrategyType strategyType = AttributeMappingStrategyType.MERGE;
    SysSystemDto system = createSystem();
    SysSchemaObjectClassDto objectClass = createObjectClass(system);
    SysSystemMappingDto systemMapping = testHelper.createMappingSystem(entityType, objectClass);
    SysSchemaAttributeDto schemaAttribute = createSchemaAttribute(objectClass);
    SysSchemaAttributeDto schemaAttribute2 = createSchemaAttribute(objectClass);
    SysSystemAttributeMappingDto attributeMapping = createAttributeMappingSystem(systemMapping, strategyType, schemaAttribute.getId());
    SysSystemAttributeMappingDto attributeMapping2 = createAttributeMappingSystem(systemMapping, strategyType, schemaAttribute2.getId());
    SysSystemAttributeMappingFilter filter = new SysSystemAttributeMappingFilter();
    filter.setSchemaAttributeId(schemaAttribute.getId());
    Page<SysSystemAttributeMappingDto> result = attributeMappingService.find(filter, null, permission);
    assertEquals(1, result.getTotalElements());
    assertTrue(result.getContent().contains(attributeMapping));
    assertFalse(result.getContent().contains(attributeMapping2));
}
Also used : SysSystemAttributeMappingFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSystemAttributeMappingFilter) AttributeMappingStrategyType(eu.bcvsolutions.idm.acc.domain.AttributeMappingStrategyType) SysSchemaAttributeDto(eu.bcvsolutions.idm.acc.dto.SysSchemaAttributeDto) SysSystemAttributeMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto) IdmBasePermission(eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission) SystemEntityType(eu.bcvsolutions.idm.acc.domain.SystemEntityType) SysSystemMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto) SysSchemaObjectClassDto(eu.bcvsolutions.idm.acc.dto.SysSchemaObjectClassDto) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Test(org.junit.Test)

Example 13 with SysSystemAttributeMappingDto

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

the class DefaultSysSystemAttributeMappingServiceTest method isUidFitlerTest.

@Test
public void isUidFitlerTest() {
    IdmBasePermission permission = IdmBasePermission.ADMIN;
    SystemEntityType entityType = SystemEntityType.IDENTITY;
    AttributeMappingStrategyType strategyType = AttributeMappingStrategyType.MERGE;
    SysSystemDto system = createSystem();
    SysSchemaObjectClassDto objectClass = createObjectClass(system);
    SysSystemMappingDto systemMapping1 = testHelper.createMappingSystem(entityType, objectClass);
    SysSystemMappingDto systemMapping2 = testHelper.createMappingSystem(entityType, objectClass);
    SysSchemaAttributeDto schemaAttribute = createSchemaAttribute(objectClass);
    SysSystemAttributeMappingDto attributeMapping1 = createAttributeMappingSystem(systemMapping1, AttributeMappingStrategyType.CREATE, schemaAttribute.getId());
    SysSystemAttributeMappingDto attributeMapping2 = createAttributeMappingSystem(systemMapping2, strategyType, schemaAttribute.getId());
    attributeMapping2.setUid(true);
    attributeMappingService.save(attributeMapping2);
    createAttributeMappingSystem(systemMapping1, AttributeMappingStrategyType.SET, schemaAttribute.getId());
    SysSystemAttributeMappingFilter filter = new SysSystemAttributeMappingFilter();
    filter.setIsUid(true);
    filter.setSystemId(system.getId());
    Page<SysSystemAttributeMappingDto> result = attributeMappingService.find(filter, null, permission);
    assertEquals(1, result.getTotalElements());
    assertTrue(result.getContent().contains(attributeMapping2));
    assertFalse(result.getContent().contains(attributeMapping1));
}
Also used : SysSystemAttributeMappingFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSystemAttributeMappingFilter) AttributeMappingStrategyType(eu.bcvsolutions.idm.acc.domain.AttributeMappingStrategyType) SysSchemaAttributeDto(eu.bcvsolutions.idm.acc.dto.SysSchemaAttributeDto) SysSystemAttributeMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto) IdmBasePermission(eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission) SystemEntityType(eu.bcvsolutions.idm.acc.domain.SystemEntityType) SysSystemMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto) SysSchemaObjectClassDto(eu.bcvsolutions.idm.acc.dto.SysSchemaObjectClassDto) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Test(org.junit.Test)

Example 14 with SysSystemAttributeMappingDto

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

the class DefaultSysSystemAttributeMappingServiceTest method textFilterTest.

@Test
public void textFilterTest() {
    IdmBasePermission permission = IdmBasePermission.ADMIN;
    SystemEntityType entityType = SystemEntityType.IDENTITY;
    AttributeMappingStrategyType strategyType = AttributeMappingStrategyType.MERGE;
    SysSystemDto system = createSystem();
    SysSchemaObjectClassDto objectClass = createObjectClass(system);
    SysSystemMappingDto systemMapping = testHelper.createMappingSystem(entityType, objectClass);
    SysSchemaAttributeDto schemaAttribute = createSchemaAttribute(objectClass);
    SysSystemAttributeMappingDto attributeMapping1 = createAttributeMappingSystem(systemMapping, strategyType, schemaAttribute.getId());
    attributeMapping1.setName("OriginalName01");
    attributeMappingService.save(attributeMapping1);
    SysSystemAttributeMappingDto attributeMapping2 = createAttributeMappingSystem(systemMapping, AttributeMappingStrategyType.CREATE, schemaAttribute.getId());
    attributeMapping2.setName("OriginalName21");
    attributeMappingService.save(attributeMapping2);
    SysSystemAttributeMappingFilter filter = new SysSystemAttributeMappingFilter();
    filter.setText("OriginalName0");
    Page<SysSystemAttributeMappingDto> result = attributeMappingService.find(filter, null, permission);
    assertEquals(1, result.getTotalElements());
    assertTrue(result.getContent().contains(attributeMapping1));
    assertFalse(result.getContent().contains(attributeMapping2));
}
Also used : SysSystemAttributeMappingFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSystemAttributeMappingFilter) AttributeMappingStrategyType(eu.bcvsolutions.idm.acc.domain.AttributeMappingStrategyType) SysSchemaAttributeDto(eu.bcvsolutions.idm.acc.dto.SysSchemaAttributeDto) SysSystemAttributeMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto) IdmBasePermission(eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission) SystemEntityType(eu.bcvsolutions.idm.acc.domain.SystemEntityType) SysSystemMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto) SysSchemaObjectClassDto(eu.bcvsolutions.idm.acc.dto.SysSchemaObjectClassDto) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Test(org.junit.Test)

Example 15 with SysSystemAttributeMappingDto

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

the class DefaultTreeSynchronizationServiceTest method doCreateSyncConfig.

@Test
@Transactional
public void doCreateSyncConfig() {
    initData();
    SysSystemMappingFilter mappingFilter = new SysSystemMappingFilter();
    mappingFilter.setEntityType(SystemEntityType.TREE);
    mappingFilter.setSystemId(system.getId());
    mappingFilter.setOperationType(SystemOperationType.SYNCHRONIZATION);
    List<SysSystemMappingDto> mappings = systemMappingService.find(mappingFilter, null).getContent();
    Assert.assertEquals(1, mappings.size());
    SysSystemMappingDto mapping = mappings.get(0);
    SysSystemAttributeMappingFilter attributeMappingFilter = new SysSystemAttributeMappingFilter();
    attributeMappingFilter.setSystemMappingId(mapping.getId());
    List<SysSystemAttributeMappingDto> attributes = schemaAttributeMappingService.find(attributeMappingFilter, null).getContent();
    SysSystemAttributeMappingDto uidAttribute = attributes.stream().filter(attribute -> {
        return attribute.isUid();
    }).findFirst().get();
    // Create default synchronization config
    AbstractSysSyncConfigDto syncConfigCustom = new SysSyncConfigDto();
    syncConfigCustom.setReconciliation(true);
    syncConfigCustom.setCustomFilter(true);
    syncConfigCustom.setSystemMapping(mapping.getId());
    syncConfigCustom.setCorrelationAttribute(uidAttribute.getId());
    syncConfigCustom.setReconciliation(true);
    syncConfigCustom.setName(SYNC_CONFIG_NAME);
    syncConfigCustom.setLinkedAction(SynchronizationLinkedActionType.IGNORE);
    syncConfigCustom.setUnlinkedAction(SynchronizationUnlinkedActionType.IGNORE);
    syncConfigCustom.setMissingEntityAction(SynchronizationMissingEntityActionType.CREATE_ENTITY);
    syncConfigCustom.setMissingAccountAction(ReconciliationMissingAccountActionType.IGNORE);
    syncConfigService.save(syncConfigCustom);
    SysSyncConfigFilter configFilter = new SysSyncConfigFilter();
    configFilter.setSystemId(system.getId());
    Assert.assertEquals(1, syncConfigService.find(configFilter, null).getTotalElements());
}
Also used : AbstractSysSyncConfigDto(eu.bcvsolutions.idm.acc.dto.AbstractSysSyncConfigDto) SysSystemAttributeMappingFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSystemAttributeMappingFilter) SysSystemMappingFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSystemMappingFilter) SysSystemAttributeMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto) SysSystemMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto) SysSyncConfigDto(eu.bcvsolutions.idm.acc.dto.SysSyncConfigDto) AbstractSysSyncConfigDto(eu.bcvsolutions.idm.acc.dto.AbstractSysSyncConfigDto) SysSyncConfigFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSyncConfigFilter) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Test(org.junit.Test) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

SysSystemAttributeMappingDto (eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto)78 SysSystemMappingDto (eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto)48 SysSystemDto (eu.bcvsolutions.idm.acc.dto.SysSystemDto)42 SysSystemAttributeMappingFilter (eu.bcvsolutions.idm.acc.dto.filter.SysSystemAttributeMappingFilter)37 SysSchemaAttributeDto (eu.bcvsolutions.idm.acc.dto.SysSchemaAttributeDto)34 AbstractIntegrationTest (eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)29 Test (org.junit.Test)29 SysSchemaObjectClassDto (eu.bcvsolutions.idm.acc.dto.SysSchemaObjectClassDto)26 IdmIdentityDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto)26 AccAccountDto (eu.bcvsolutions.idm.acc.dto.AccAccountDto)21 SystemEntityType (eu.bcvsolutions.idm.acc.domain.SystemEntityType)20 SysSchemaAttributeFilter (eu.bcvsolutions.idm.acc.dto.filter.SysSchemaAttributeFilter)20 AbstractSysSyncConfigDto (eu.bcvsolutions.idm.acc.dto.AbstractSysSyncConfigDto)19 GuardedString (eu.bcvsolutions.idm.core.security.api.domain.GuardedString)18 AccIdentityAccountDto (eu.bcvsolutions.idm.acc.dto.AccIdentityAccountDto)14 SysSyncLogDto (eu.bcvsolutions.idm.acc.dto.SysSyncLogDto)14 IdmRoleDto (eu.bcvsolutions.idm.core.api.dto.IdmRoleDto)14 SysSyncActionLogDto (eu.bcvsolutions.idm.acc.dto.SysSyncActionLogDto)13 SysSyncItemLogDto (eu.bcvsolutions.idm.acc.dto.SysSyncItemLogDto)13 AccIdentityAccountFilter (eu.bcvsolutions.idm.acc.dto.filter.AccIdentityAccountFilter)13