use of eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission in project CzechIdMng by bcvsolutions.
the class DefaultSysProvisioningArchiveServiceTest method operationTypeFilterTest.
@Test
public void operationTypeFilterTest() {
IdmBasePermission permission = IdmBasePermission.ADMIN;
SystemEntityType entityType = SystemEntityType.IDENTITY;
SysSystemDto system = createRoleSystem();
SysProvisioningArchiveDto provisioningArchive1 = createProvisioningArchive(entityType, system);
SysProvisioningArchiveDto provisioningArchive2 = createProvisioningArchive(entityType, system);
provisioningArchive2.setOperationType(ProvisioningEventType.UPDATE);
archiveService.save(provisioningArchive2);
SysProvisioningArchiveDto provisioningArchive3 = createProvisioningArchive(entityType, system);
provisioningArchive3.setOperationType(ProvisioningEventType.UPDATE);
archiveService.save(provisioningArchive3);
SysProvisioningOperationFilter filter = new SysProvisioningOperationFilter();
filter.setOperationType(ProvisioningEventType.UPDATE);
filter.setSystemId(system.getId());
Page<SysProvisioningArchiveDto> result = archiveService.find(filter, null, permission);
assertEquals(2, result.getTotalElements());
assertFalse(result.getContent().contains(provisioningArchive1));
assertTrue(result.getContent().contains(provisioningArchive2));
assertTrue(result.getContent().contains(provisioningArchive3));
}
use of eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission in project CzechIdMng by bcvsolutions.
the class DefaultSysProvisioningArchiveServiceTest method systemIdFilterTest.
@Test
public void systemIdFilterTest() {
IdmBasePermission permission = IdmBasePermission.ADMIN;
SystemEntityType entityType = SystemEntityType.IDENTITY;
SysSystemDto system1 = createRoleSystem();
SysSystemDto system2 = createRoleSystem();
SysProvisioningArchiveDto provisioningArchive1 = createProvisioningArchive(entityType, system1);
SysProvisioningArchiveDto provisioningArchive2 = createProvisioningArchive(entityType, system1);
SysProvisioningArchiveDto provisioningArchive3 = createProvisioningArchive(entityType, system2);
SysProvisioningOperationFilter filter = new SysProvisioningOperationFilter();
filter.setSystemId(system1.getId());
Page<SysProvisioningArchiveDto> result = archiveService.find(filter, null, permission);
assertEquals(2, result.getTotalElements());
assertTrue(result.getContent().contains(provisioningArchive1));
assertTrue(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 DefaultSysProvisioningArchiveServiceTest method resultStateFilterTest.
@Test
public void resultStateFilterTest() {
IdmBasePermission permission = IdmBasePermission.ADMIN;
SystemEntityType entityType = SystemEntityType.IDENTITY;
SysSystemDto system = createRoleSystem();
OperationResult resultState = new OperationResult();
resultState.setState(OperationState.CREATED);
SysProvisioningArchiveDto provisioningArchive1 = createProvisioningArchive(entityType, system);
SysProvisioningArchiveDto provisioningArchive2 = createProvisioningArchive(entityType, system);
provisioningArchive2.setResult(resultState);
archiveService.save(provisioningArchive2);
SysProvisioningOperationFilter filter = new SysProvisioningOperationFilter();
filter.setResultState(OperationState.CREATED);
Page<SysProvisioningArchiveDto> result = archiveService.find(filter, null, permission);
assertEquals(1, result.getTotalElements());
assertFalse(result.getContent().contains(provisioningArchive1));
assertTrue(result.getContent().contains(provisioningArchive2));
}
use of eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission in project CzechIdMng by bcvsolutions.
the class DefaultSysSystemMappingServiceTest method textFilterTest.
@Test
public void textFilterTest() {
IdmBasePermission permission = IdmBasePermission.ADMIN;
SystemEntityType entityType = SystemEntityType.IDENTITY;
SysSystemDto system = createSystem();
SysSchemaObjectClassDto objectClass = createObjectClass(system);
SysSystemMappingDto mappingSystem1 = testHelper.createMappingSystem(entityType, objectClass);
mappingSystem1.setName("SomeName01");
mappingService.save(mappingSystem1);
SysSystemMappingDto mappingSystem2 = testHelper.createMappingSystem(entityType, objectClass);
mappingSystem2.setName("SomeName02");
mappingService.save(mappingSystem2);
SysSystemMappingDto mappingSystem3 = testHelper.createMappingSystem(entityType, objectClass);
mappingSystem3.setName("SomeName22");
mappingService.save(mappingSystem3);
SysSystemMappingFilter filter = new SysSystemMappingFilter();
filter.setText("SomeName0");
Page<SysSystemMappingDto> result = mappingService.find(filter, null, permission);
assertEquals(2, result.getTotalElements());
assertTrue(result.getContent().contains(mappingSystem1));
assertTrue(result.getContent().contains(mappingSystem2));
}
use of eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission in project CzechIdMng by bcvsolutions.
the class DefaultSysSystemMappingServiceTest method systemIdFilterTest.
@Test
public void systemIdFilterTest() {
IdmBasePermission permission = IdmBasePermission.ADMIN;
SystemEntityType entityType = SystemEntityType.IDENTITY;
SysSystemDto system = createSystem();
SysSchemaObjectClassDto objectClass = createObjectClass(system);
SysSystemDto system2 = createSystem();
SysSchemaObjectClassDto objectClass2 = createObjectClass(system2);
SysSystemMappingDto mappingSystem1 = testHelper.createMappingSystem(entityType, objectClass);
SysSystemMappingDto mappingSystem2 = testHelper.createMappingSystem(entityType, objectClass2);
SysSystemMappingFilter filter = new SysSystemMappingFilter();
filter.setSystemId(system.getId());
Page<SysSystemMappingDto> result = mappingService.find(filter, null, permission);
assertEquals(1, result.getTotalElements());
assertTrue(result.getContent().contains(mappingSystem1));
assertFalse(result.getContent().contains(mappingSystem2));
}
Aggregations