use of eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission in project CzechIdMng by bcvsolutions.
the class DefaultSysProvisioningArchiveServiceTest method entityIdentifierFilterTest.
@Test
public void entityIdentifierFilterTest() {
IdmBasePermission permission = IdmBasePermission.ADMIN;
SystemEntityType entityType = SystemEntityType.IDENTITY;
SysSystemDto system = createRoleSystem();
createProvisioningArchive(entityType, system);
SysProvisioningArchiveDto provisioningArchive1 = createProvisioningArchive(entityType, system);
provisioningArchive1.setEntityIdentifier(UUID.randomUUID());
provisioningArchive1 = archiveService.save(provisioningArchive1);
SysProvisioningArchiveDto provisioningArchive2 = createProvisioningArchive(entityType, system);
SysProvisioningOperationFilter filter = new SysProvisioningOperationFilter();
filter.setEntityIdentifier(provisioningArchive1.getEntityIdentifier());
Page<SysProvisioningArchiveDto> result = archiveService.find(filter, null, permission);
assertEquals(1, result.getTotalElements());
assertTrue(result.getContent().contains(provisioningArchive1));
assertFalse(result.getContent().contains(provisioningArchive2));
}
use of eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission in project CzechIdMng by bcvsolutions.
the class DefaultSysProvisioningArchiveServiceTest method typeFilterTest.
@Test
public void typeFilterTest() {
IdmBasePermission permission = IdmBasePermission.ADMIN;
SysSystemDto system = createRoleSystem();
SysProvisioningArchiveDto provisioningOperation1 = createProvisioningArchive(SystemEntityType.CONTRACT, system);
SysProvisioningArchiveDto provisioningOperation2 = createProvisioningArchive(SystemEntityType.IDENTITY, system);
SysProvisioningArchiveDto provisioningOperation3 = createProvisioningArchive(SystemEntityType.CONTRACT, system);
SysProvisioningOperationFilter filter = new SysProvisioningOperationFilter();
filter.setEntityType(SystemEntityType.CONTRACT);
Page<SysProvisioningArchiveDto> result = archiveService.find(filter, null, permission);
assertEquals(2, result.getTotalElements());
assertTrue(result.getContent().contains(provisioningOperation1));
assertTrue(result.getContent().contains(provisioningOperation3));
assertFalse(result.getContent().contains(provisioningOperation2));
}
use of eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission in project CzechIdMng by bcvsolutions.
the class DefaultSysProvisioningArchiveServiceTest method systemEntityUidFilterTest.
@Test
public void systemEntityUidFilterTest() {
IdmBasePermission permission = IdmBasePermission.ADMIN;
SystemEntityType entityType = SystemEntityType.IDENTITY;
SysSystemDto system = createRoleSystem();
SysProvisioningArchiveDto provisioningArchive1 = createProvisioningArchive(entityType, system);
SysProvisioningArchiveDto provisioningArchive2 = createProvisioningArchive(entityType, system);
SysProvisioningArchiveDto provisioningArchive3 = createProvisioningArchive(entityType, system);
SysProvisioningOperationFilter filter = new SysProvisioningOperationFilter();
filter.setSystemEntityUid(provisioningArchive1.getSystemEntityUid());
Page<SysProvisioningArchiveDto> result = archiveService.find(filter, null, permission);
assertEquals(1, result.getTotalElements());
assertTrue(result.getContent().contains(provisioningArchive1));
assertFalse(result.getContent().contains(provisioningArchive2));
assertFalse(result.getContent().contains(provisioningArchive3));
}
use of eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission in project CzechIdMng by bcvsolutions.
the class DefaultSysProvisioningBatchServiceTest method emptyFilterTest.
@Test
public void emptyFilterTest() {
IdmBasePermission permission = IdmBasePermission.ADMIN;
SysProvisioningBatchDto provisioningBatch = new SysProvisioningBatchDto();
provisioningBatch.setId(UUID.randomUUID());
batchService.save(provisioningBatch);
EmptyFilter filter = new EmptyFilter();
Page<SysProvisioningBatchDto> result = batchService.find(filter, null, permission);
assertTrue(result.getContent().contains(provisioningBatch));
}
use of eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission 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("PropName42");
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