use of eu.bcvsolutions.idm.acc.domain.SystemEntityType in project CzechIdMng by bcvsolutions.
the class DefaultSysSystemMappingServiceIntegrationTest method objectClassFilterTest.
@Test
public void objectClassFilterTest() {
IdmBasePermission permission = IdmBasePermission.ADMIN;
SystemEntityType entityType = SystemEntityType.IDENTITY;
SysSystemDto system = createSystem();
SysSystemDto system2 = createSystem();
SysSchemaObjectClassDto objectClass = createObjectClass(system);
SysSchemaObjectClassDto objectClass2 = createObjectClass(system2);
SysSystemMappingDto mappingSystem1 = testHelper.createMappingSystem(entityType, objectClass);
SysSystemMappingDto mappingSystem2 = testHelper.createMappingSystem(entityType, objectClass2);
SysSystemMappingFilter filter = new SysSystemMappingFilter();
filter.setObjectClassId(mappingSystem1.getObjectClass());
Page<SysSystemMappingDto> result = mappingService.find(filter, null, permission);
assertEquals(1, result.getTotalElements());
assertTrue(result.getContent().contains(mappingSystem1));
assertFalse(result.getContent().contains(mappingSystem2));
}
use of eu.bcvsolutions.idm.acc.domain.SystemEntityType in project CzechIdMng by bcvsolutions.
the class DefaultSysSystemMappingServiceIntegrationTest method operationTypeFilterTest.
@Test
public void operationTypeFilterTest() {
IdmBasePermission permission = IdmBasePermission.ADMIN;
SystemEntityType entityType = SystemEntityType.IDENTITY;
SysSystemDto system = createSystem();
SysSchemaObjectClassDto objectClass = createObjectClass(system);
SysSystemMappingDto mappingSystem1 = testHelper.createMappingSystem(entityType, objectClass);
createProvisioningMappingSystem(SystemEntityType.TREE, objectClass);
SysSystemMappingDto mappingSystem3 = createProvisioningMappingSystem(entityType, objectClass);
SysSystemMappingFilter filter = new SysSystemMappingFilter();
filter.setOperationType(SystemOperationType.PROVISIONING);
filter.setSystemId(system.getId());
Page<SysSystemMappingDto> result = mappingService.find(filter, null, permission);
assertEquals(2, result.getTotalElements());
assertTrue(result.getContent().contains(mappingSystem3));
assertFalse(result.getContent().contains(mappingSystem1));
}
use of eu.bcvsolutions.idm.acc.domain.SystemEntityType in project CzechIdMng by bcvsolutions.
the class DefaultSysSystemAttributeMappingServiceTest method moreAttributesOnSchemaAttChangeMappingTypeTest.
@Test(expected = ResultCodeException.class)
public void moreAttributesOnSchemaAttChangeMappingTypeTest() {
SystemEntityType entityType = SystemEntityType.IDENTITY;
AttributeMappingStrategyType strategyType = AttributeMappingStrategyType.SET;
SysSystemDto system = createSystem();
SysSchemaObjectClassDto objectClass = createObjectClass(system);
SysSystemMappingDto systemMapping = testHelper.createMappingSystem(entityType, objectClass);
// For synchronization is enabled more mapped attributes for one schema
// attribute
systemMapping.setOperationType(SystemOperationType.SYNCHRONIZATION);
systemMapping = mappingService.save(systemMapping);
SysSchemaAttributeDto schemaAttribute = createSchemaAttribute(objectClass);
SysSystemAttributeMappingDto attributeMapping1 = createAttributeMappingSystem(systemMapping, strategyType, schemaAttribute.getId());
attributeMapping1.setName("attributeOne");
attributeMapping1 = attributeMappingService.save(attributeMapping1);
SysSystemAttributeMappingDto attributeMapping2 = createAttributeMappingSystem(systemMapping, strategyType, schemaAttribute.getId());
attributeMapping2.setName("attributeTwo");
attributeMapping2 = attributeMappingService.save(attributeMapping2);
assertNotNull(attributeMapping1.getId());
assertNotNull(attributeMapping2.getId());
// For provisioning is NOT enabled more mapped attributes for one schema
// attribute. On change operation type form SYNC to PROVISIONING, has to be
// throw exception!
systemMapping.setOperationType(SystemOperationType.PROVISIONING);
systemMapping = mappingService.save(systemMapping);
}
use of eu.bcvsolutions.idm.acc.domain.SystemEntityType in project CzechIdMng by bcvsolutions.
the class DefaultSysSystemAttributeMappingServiceTest method moreAttributesOnSchemaAttributeSyncTest.
@Test
public void moreAttributesOnSchemaAttributeSyncTest() {
SystemEntityType entityType = SystemEntityType.IDENTITY;
AttributeMappingStrategyType strategyType = AttributeMappingStrategyType.SET;
SysSystemDto system = createSystem();
SysSchemaObjectClassDto objectClass = createObjectClass(system);
SysSystemMappingDto systemMapping = testHelper.createMappingSystem(entityType, objectClass);
// For synchronization is enabled more mapped attributes for one schema
// attribute
systemMapping.setOperationType(SystemOperationType.SYNCHRONIZATION);
systemMapping = mappingService.save(systemMapping);
SysSchemaAttributeDto schemaAttribute = createSchemaAttribute(objectClass);
SysSystemAttributeMappingDto attributeMapping1 = createAttributeMappingSystem(systemMapping, strategyType, schemaAttribute.getId());
attributeMapping1.setName("attributeOne");
attributeMapping1 = attributeMappingService.save(attributeMapping1);
SysSystemAttributeMappingDto attributeMapping2 = createAttributeMappingSystem(systemMapping, strategyType, schemaAttribute.getId());
attributeMapping2.setName("attributeTwo");
attributeMapping2 = attributeMappingService.save(attributeMapping2);
assertNotNull(attributeMapping1.getId());
assertNotNull(attributeMapping2.getId());
}
use of eu.bcvsolutions.idm.acc.domain.SystemEntityType in project CzechIdMng by bcvsolutions.
the class DefaultSysSystemAttributeMappingServiceTest method idmPropertyNameFilterTest.
@Test
public void idmPropertyNameFilterTest() {
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.setIdmPropertyName("PropName31");
attributeMappingService.save(attributeMapping1);
SysSystemAttributeMappingDto attributeMapping2 = createAttributeMappingSystem(systemMapping, AttributeMappingStrategyType.CREATE, schemaAttribute.getId());
attributeMapping2.setIdmPropertyName("PropName4");
attributeMappingService.save(attributeMapping2);
SysSystemAttributeMappingFilter filter = new SysSystemAttributeMappingFilter();
filter.setIdmPropertyName("PropName4");
Page<SysSystemAttributeMappingDto> result = attributeMappingService.find(filter, null, permission);
assertEquals(1, result.getTotalElements());
assertTrue(result.getContent().contains(attributeMapping2));
assertFalse(result.getContent().contains(attributeMapping1));
}
Aggregations