use of eu.bcvsolutions.idm.acc.dto.SysProvisioningArchiveDto 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.acc.dto.SysProvisioningArchiveDto in project CzechIdMng by bcvsolutions.
the class DefaultSysProvisioningArchiveService method archive.
@Override
// we want log in archive always
@Transactional(propagation = Propagation.REQUIRES_NEW)
public SysProvisioningArchiveDto archive(SysProvisioningOperationDto provisioningOperation) {
Builder builder = new SysProvisioningArchiveDto.Builder(provisioningOperation);
if (provisioningOperation.getSystemEntity() != null) {
SysSystemEntityDto systemEntity = systemEntityService.get(provisioningOperation.getSystemEntity());
builder.setSystemEntityUid(systemEntity.getUid());
}
SysProvisioningArchiveDto archive = builder.build();
// preserve original operation creator
archive.setCreator(provisioningOperation.getCreator());
archive.setCreatorId(provisioningOperation.getCreatorId());
archive.setOriginalCreator(provisioningOperation.getOriginalCreator());
archive.setOriginalCreatorId(provisioningOperation.getOriginalCreatorId());
return save(archive);
}
Aggregations