use of eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission in project CzechIdMng by bcvsolutions.
the class DefaultSysSystemMappingServiceTest 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.core.security.api.domain.IdmBasePermission in project CzechIdMng by bcvsolutions.
the class DefaultSysSystemMappingServiceTest 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.core.security.api.domain.IdmBasePermission in project CzechIdMng by bcvsolutions.
the class SysProvisioningOperationFilterIntegrationTest method entityIdentifierFilterTest.
@Test
public void entityIdentifierFilterTest() {
IdmBasePermission permission = IdmBasePermission.ADMIN;
SystemEntityType entityType = SystemEntityType.IDENTITY;
SysSystemDto system = createSystem();
createProvisioningOperation(entityType, system);
SysProvisioningOperationDto provisioningOperation1 = createProvisioningOperation(entityType, system);
provisioningOperation1.setEntityIdentifier(UUID.randomUUID());
operationService.save(provisioningOperation1);
SysProvisioningOperationDto provisioningOperation2 = createProvisioningOperation(entityType, system);
SysProvisioningOperationFilter filter = new SysProvisioningOperationFilter();
filter.setEntityIdentifier(provisioningOperation1.getEntityIdentifier());
filter.setSystemId(system.getId());
Page<SysProvisioningOperationDto> result = operationService.find(filter, null, permission);
assertEquals(1, result.getTotalElements());
assertTrue(result.getContent().contains(provisioningOperation1));
assertFalse(result.getContent().contains(provisioningOperation2));
}
use of eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission in project CzechIdMng by bcvsolutions.
the class SysProvisioningOperationFilterIntegrationTest method resultStateFilterTest.
@Test
public void resultStateFilterTest() {
IdmBasePermission permission = IdmBasePermission.ADMIN;
SystemEntityType entityType = SystemEntityType.IDENTITY;
SysSystemDto system = createSystem();
OperationResult resultState = new OperationResult();
resultState.setState(OperationState.CREATED);
SysProvisioningOperationDto provisioningOperation1 = createProvisioningOperation(entityType, system);
SysProvisioningOperationDto provisioningOperation2 = createProvisioningOperation(entityType, system);
provisioningOperation2.setResult(resultState);
operationService.save(provisioningOperation2);
SysProvisioningOperationFilter filter = new SysProvisioningOperationFilter();
filter.setResultState(OperationState.CREATED);
filter.setSystemId(system.getId());
Page<SysProvisioningOperationDto> result = operationService.find(filter, null, permission);
assertEquals(1, result.getTotalElements());
assertTrue(result.getContent().contains(provisioningOperation2));
assertFalse(result.getContent().contains(provisioningOperation1));
}
use of eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission in project CzechIdMng by bcvsolutions.
the class SysProvisioningOperationFilterIntegrationTest method operationTypeFilterTest.
@Test
public void operationTypeFilterTest() {
IdmBasePermission permission = IdmBasePermission.ADMIN;
SystemEntityType entityType = SystemEntityType.IDENTITY;
SysSystemDto system = createSystem();
SysProvisioningOperationDto provisioningOperation1 = createProvisioningOperation(entityType, system);
SysProvisioningOperationDto provisioningOperation2 = createProvisioningOperation(entityType, system);
provisioningOperation2.setOperationType(ProvisioningEventType.CANCEL);
operationService.save(provisioningOperation2);
SysProvisioningOperationDto provisioningOperation3 = createProvisioningOperation(entityType, system);
provisioningOperation3.setOperationType(ProvisioningEventType.CANCEL);
operationService.save(provisioningOperation3);
SysProvisioningOperationFilter filter = new SysProvisioningOperationFilter();
filter.setSystemId(system.getId());
filter.setOperationType(ProvisioningEventType.CANCEL);
Page<SysProvisioningOperationDto> result = operationService.find(filter, null, permission);
assertEquals(2, result.getTotalElements());
assertTrue(result.getContent().contains(provisioningOperation2));
assertFalse(result.getContent().contains(provisioningOperation1));
}
Aggregations