Search in sources :

Example 71 with SysSystemMappingFilter

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

the class DefaultSysSystemAttributeMappingServiceFilterTest method testFilterByOperationTypeNotFound.

@Test
public void testFilterByOperationTypeNotFound() {
    SysSystemDto system = this.getHelper().createTestResourceSystem(true, getHelper().createName());
    // Generate second system for add mapped attributes
    this.getHelper().createTestResourceSystem(true, getHelper().createName());
    SysSystemMappingFilter filterMapping = new SysSystemMappingFilter();
    filterMapping.setSystemId(system.getId());
    List<SysSystemMappingDto> mappings = systemMappingService.find(filterMapping, null).getContent();
    assertEquals(1, mappings.size());
    SysSystemAttributeMappingFilter filter = new SysSystemAttributeMappingFilter();
    filter.setSystemId(system.getId());
    filter.setOperationType(SystemOperationType.SYNCHRONIZATION);
    List<SysSystemAttributeMappingDto> attributeMappings = systemAttributeMappingService.find(filter, null).getContent();
    assertEquals(0, attributeMappings.size());
}
Also used : 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) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) Test(org.junit.Test) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)

Example 72 with SysSystemMappingFilter

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

the class DefaultSysSystemAttributeMappingServiceFilterTest method testFilterByOnlySchemaName.

@Test
public void testFilterByOnlySchemaName() {
    SysSystemDto system = this.getHelper().createTestResourceSystem(true, getHelper().createName());
    // Generate second system for add mapped attributes
    this.getHelper().createTestResourceSystem(true, getHelper().createName());
    SysSystemMappingFilter filterMapping = new SysSystemMappingFilter();
    filterMapping.setSystemId(system.getId());
    List<SysSystemMappingDto> mappings = systemMappingService.find(filterMapping, null).getContent();
    assertEquals(1, mappings.size());
    SysSystemMappingDto mappingDto = mappings.get(0);
    SysSystemAttributeMappingFilter filter = new SysSystemAttributeMappingFilter();
    filter.setSystemMappingId(mappingDto.getId());
    filter.setSchemaAttributeName(TestHelper.ATTRIBUTE_MAPPING_FIRSTNAME);
    List<SysSystemAttributeMappingDto> attributeMappings = systemAttributeMappingService.find(filter, null).getContent();
    assertEquals(1, attributeMappings.size());
    SysSystemAttributeMappingDto attributeMappingDto = attributeMappings.get(0);
    assertEquals(TestHelper.ATTRIBUTE_MAPPING_FIRSTNAME, attributeMappingDto.getName());
    assertEquals(mappingDto.getId(), attributeMappingDto.getSystemMapping());
    SysSchemaAttributeDto schemaAttributeDto = schemaAttributeService.get(attributeMappingDto.getSchemaAttribute());
    String newName = getHelper().createName();
    schemaAttributeDto.setName(newName);
    schemaAttributeService.save(schemaAttributeDto);
    attributeMappings = systemAttributeMappingService.find(filter, null).getContent();
    assertEquals(0, attributeMappings.size());
    filter.setSchemaAttributeName(newName);
    attributeMappings = systemAttributeMappingService.find(filter, null).getContent();
    assertEquals(1, attributeMappings.size());
    attributeMappingDto = attributeMappings.get(0);
    assertEquals(schemaAttributeDto.getId(), attributeMappingDto.getSchemaAttribute());
    assertEquals(mappingDto.getId(), attributeMappingDto.getSystemMapping());
    // Empty filter
    filter = new SysSystemAttributeMappingFilter();
    filter.setSchemaAttributeName(newName);
    attributeMappings = systemAttributeMappingService.find(filter, null).getContent();
    assertEquals(1, attributeMappings.size());
    attributeMappingDto = attributeMappings.get(0);
    assertEquals(schemaAttributeDto.getId(), attributeMappingDto.getSchemaAttribute());
    assertEquals(mappingDto.getId(), attributeMappingDto.getSystemMapping());
}
Also used : SysSystemAttributeMappingFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSystemAttributeMappingFilter) SysSystemMappingFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSystemMappingFilter) SysSystemAttributeMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto) SysSchemaAttributeDto(eu.bcvsolutions.idm.acc.dto.SysSchemaAttributeDto) SysSystemMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) Test(org.junit.Test) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)

Example 73 with SysSystemMappingFilter

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

the class DefaultSysSystemAttributeMappingServiceFilterTest method testFilterByEntityTypeAndOperationNotFound.

@Test
public void testFilterByEntityTypeAndOperationNotFound() {
    SysSystemDto system = this.getHelper().createTestResourceSystem(true, getHelper().createName());
    // Generate second system for add mapped attributes
    this.getHelper().createTestResourceSystem(true, getHelper().createName());
    SysSystemMappingFilter filterMapping = new SysSystemMappingFilter();
    filterMapping.setSystemId(system.getId());
    List<SysSystemMappingDto> mappings = systemMappingService.find(filterMapping, null).getContent();
    assertEquals(1, mappings.size());
    SysSystemAttributeMappingFilter filter = new SysSystemAttributeMappingFilter();
    filter.setSystemId(system.getId());
    filter.setEntityType(SystemEntityType.IDENTITY);
    filter.setOperationType(SystemOperationType.SYNCHRONIZATION);
    List<SysSystemAttributeMappingDto> attributeMappings = systemAttributeMappingService.find(filter, null).getContent();
    assertEquals(0, attributeMappings.size());
}
Also used : 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) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) Test(org.junit.Test) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)

Example 74 with SysSystemMappingFilter

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

the class DefaultSysSystemAttributeMappingServiceFilterTest method testFilterByAuthenticationAttributeNotFound.

@Test
public void testFilterByAuthenticationAttributeNotFound() {
    SysSystemDto system = this.getHelper().createTestResourceSystem(true, getHelper().createName());
    // Generate second system for add mapped attributes
    this.getHelper().createTestResourceSystem(true, getHelper().createName());
    SysSystemMappingFilter filterMapping = new SysSystemMappingFilter();
    filterMapping.setSystemId(system.getId());
    List<SysSystemMappingDto> mappings = systemMappingService.find(filterMapping, null).getContent();
    assertEquals(1, mappings.size());
    SysSystemAttributeMappingFilter filter = new SysSystemAttributeMappingFilter();
    filter.setSystemId(system.getId());
    filter.setAuthenticationAttribute(Boolean.TRUE);
    List<SysSystemAttributeMappingDto> attributeMappings = systemAttributeMappingService.find(filter, null).getContent();
    assertEquals(0, attributeMappings.size());
}
Also used : 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) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) Test(org.junit.Test) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)

Example 75 with SysSystemMappingFilter

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

the class DefaultSysSystemAttributeMappingServiceFilterTest method testFilterByEntityTypeAndOperationAndUid.

@Test
public void testFilterByEntityTypeAndOperationAndUid() {
    SysSystemDto system = this.getHelper().createTestResourceSystem(true, getHelper().createName());
    // Generate second system for add mapped attributes
    this.getHelper().createTestResourceSystem(true, getHelper().createName());
    SysSystemMappingFilter filterMapping = new SysSystemMappingFilter();
    filterMapping.setSystemId(system.getId());
    List<SysSystemMappingDto> mappings = systemMappingService.find(filterMapping, null).getContent();
    assertEquals(1, mappings.size());
    SysSystemAttributeMappingFilter filter = new SysSystemAttributeMappingFilter();
    filter.setSystemId(system.getId());
    filter.setEntityType(SystemEntityType.IDENTITY);
    filter.setOperationType(SystemOperationType.PROVISIONING);
    filter.setIsUid(Boolean.FALSE);
    List<SysSystemAttributeMappingDto> attributeMappings = systemAttributeMappingService.find(filter, null).getContent();
    // Without UID attribute
    assertEquals(5, attributeMappings.size());
    filter.setIsUid(Boolean.TRUE);
    attributeMappings = systemAttributeMappingService.find(filter, null).getContent();
    assertEquals(1, attributeMappings.size());
    SysSystemAttributeMappingDto attributeMappingDto = attributeMappings.get(0);
    assertTrue(attributeMappingDto.isUid());
    assertEquals(TestHelper.ATTRIBUTE_MAPPING_NAME, attributeMappingDto.getName());
}
Also used : 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) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) Test(org.junit.Test) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)

Aggregations

SysSystemMappingFilter (eu.bcvsolutions.idm.acc.dto.filter.SysSystemMappingFilter)91 SysSystemMappingDto (eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto)84 SysSystemDto (eu.bcvsolutions.idm.acc.dto.SysSystemDto)67 Test (org.junit.Test)62 AbstractIntegrationTest (eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)55 SysSystemAttributeMappingDto (eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto)51 SysSystemAttributeMappingFilter (eu.bcvsolutions.idm.acc.dto.filter.SysSystemAttributeMappingFilter)49 SysSyncConfigFilter (eu.bcvsolutions.idm.acc.dto.filter.SysSyncConfigFilter)25 AbstractSysSyncConfigDto (eu.bcvsolutions.idm.acc.dto.AbstractSysSyncConfigDto)23 SysSchemaObjectClassDto (eu.bcvsolutions.idm.acc.dto.SysSchemaObjectClassDto)20 IdmBasePermission (eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission)14 SystemEntityType (eu.bcvsolutions.idm.acc.domain.SystemEntityType)11 ConnectorType (eu.bcvsolutions.idm.acc.service.api.ConnectorType)11 ConnectorTypeDto (eu.bcvsolutions.idm.acc.dto.ConnectorTypeDto)10 SysSyncIdentityConfigDto (eu.bcvsolutions.idm.acc.dto.SysSyncIdentityConfigDto)10 SysSchemaAttributeDto (eu.bcvsolutions.idm.acc.dto.SysSchemaAttributeDto)8 GuardedString (eu.bcvsolutions.idm.core.security.api.domain.GuardedString)8 Transactional (org.springframework.transaction.annotation.Transactional)8 SysSyncRoleConfigDto (eu.bcvsolutions.idm.acc.dto.SysSyncRoleConfigDto)7 SysSchemaAttributeFilter (eu.bcvsolutions.idm.acc.dto.filter.SysSchemaAttributeFilter)7