Search in sources :

Example 21 with IdmContractPositionDto

use of eu.bcvsolutions.idm.core.api.dto.IdmContractPositionDto in project CzechIdMng by bcvsolutions.

the class ContractPositionAutomaticRoleProcessor method process.

@Override
public EventResult<IdmContractPositionDto> process(EntityEvent<IdmContractPositionDto> event) {
    // flag can be processed afterwards
    if (getBooleanProperty(AutomaticRoleManager.SKIP_RECALCULATION, event.getProperties())) {
        IdmContractPositionDto contractPosition = event.getContent();
        LOG.debug("Automatic roles are skipped for position [{}], state [AUTOMATIC_ROLE_SKIPPED] for position will be created only.", contractPosition.getId());
        // 
        entityStateManager.createState(contractPosition, OperationState.BLOCKED, CoreResultCode.AUTOMATIC_ROLE_SKIPPED, null);
        // 
        return new DefaultEventResult<>(event, this);
    }
    // 
    IdmContractPositionDto contractPosition = event.getContent();
    IdmIdentityContractDto contract = DtoUtils.getEmbedded(contractPosition, IdmContractPosition_.identityContract);
    // 
    UUID newPosition = contractPosition.getWorkPosition();
    // 
    // check automatic roles - if position or contract was enabled
    // work positions has some difference or validity changes
    List<IdmIdentityRoleDto> assignedRoles = identityRoleService.findAllByContractPosition(contractPosition.getId());
    // and automatic roles given by contracts position
    if (!assignedRoles.isEmpty()) {
        assignedRoles = assignedRoles.stream().filter(autoRole -> {
            // just for sure, other contract position supports automatic role by tree structure only for now
            AbstractIdmAutomaticRoleDto automaticRoleDto = DtoUtils.getEmbedded(autoRole, IdmIdentityRole_.automaticRole, (AbstractIdmAutomaticRoleDto) null);
            if (automaticRoleDto instanceof IdmRoleTreeNodeDto) {
                return true;
            }
            return false;
        }).collect(Collectors.toList());
    }
    // 
    Set<UUID> previousAutomaticRoles = assignedRoles.stream().filter(identityRole -> {
        return identityRole.getAutomaticRole() != null;
    }).map(identityRole -> {
        return identityRole.getAutomaticRole();
    }).collect(Collectors.toSet());
    Set<IdmRoleTreeNodeDto> addedAutomaticRoles = new HashSet<>();
    if (newPosition != null) {
        addedAutomaticRoles = roleTreeNodeService.getAutomaticRolesByTreeNode(newPosition);
    }
    // prevent to remove newly added or still exists roles
    Set<UUID> removedAutomaticRoles = new HashSet<>(previousAutomaticRoles);
    removedAutomaticRoles.removeAll(addedAutomaticRoles.stream().map(IdmRoleTreeNodeDto::getId).collect(Collectors.toList()));
    addedAutomaticRoles.removeIf(a -> {
        return previousAutomaticRoles.contains(a.getId());
    });
    List<IdmConceptRoleRequestDto> concepts = new ArrayList<>(removedAutomaticRoles.size() + addedAutomaticRoles.size());
    // 
    for (UUID removedAutomaticRole : removedAutomaticRoles) {
        Iterator<IdmIdentityRoleDto> iter = assignedRoles.iterator();
        while (iter.hasNext()) {
            IdmIdentityRoleDto identityRole = iter.next();
            if (Objects.equals(identityRole.getAutomaticRole(), removedAutomaticRole)) {
                // check, if role will be added by new automatic roles and prevent removing
                IdmRoleTreeNodeDto addedAutomaticRole = getByRole(identityRole.getRole(), addedAutomaticRoles);
                if (addedAutomaticRole == null) {
                    // remove assigned role
                    IdmConceptRoleRequestDto conceptRoleRequest = new IdmConceptRoleRequestDto();
                    conceptRoleRequest.setIdentityRole(identityRole.getId());
                    conceptRoleRequest.setRole(identityRole.getRole());
                    conceptRoleRequest.setOperation(ConceptRoleRequestOperation.REMOVE);
                    // 
                    concepts.add(conceptRoleRequest);
                    // 
                    iter.remove();
                } else {
                    // change relation only
                    IdmConceptRoleRequestDto conceptRoleRequest = new IdmConceptRoleRequestDto();
                    conceptRoleRequest.setIdentityRole(identityRole.getId());
                    conceptRoleRequest.setAutomaticRole(addedAutomaticRole.getId());
                    conceptRoleRequest.setIdentityContract(contract.getId());
                    conceptRoleRequest.setContractPosition(contractPosition.getId());
                    conceptRoleRequest.setValidFrom(contract.getValidFrom());
                    conceptRoleRequest.setValidTill(contract.getValidTill());
                    conceptRoleRequest.setRole(identityRole.getRole());
                    conceptRoleRequest.setOperation(ConceptRoleRequestOperation.UPDATE);
                    // 
                    concepts.add(conceptRoleRequest);
                    // 
                    // new automatic role is not needed
                    addedAutomaticRoles.remove(addedAutomaticRole);
                }
            }
        }
    }
    // add identity roles
    for (AbstractIdmAutomaticRoleDto autoRole : addedAutomaticRoles) {
        IdmConceptRoleRequestDto conceptRoleRequest = new IdmConceptRoleRequestDto();
        conceptRoleRequest.setIdentityContract(contract.getId());
        conceptRoleRequest.setContractPosition(contractPosition.getId());
        conceptRoleRequest.setValidFrom(contract.getValidFrom());
        conceptRoleRequest.setValidTill(contract.getValidTill());
        conceptRoleRequest.setRole(autoRole.getRole());
        conceptRoleRequest.setAutomaticRole(autoRole.getId());
        conceptRoleRequest.setOperation(ConceptRoleRequestOperation.ADD);
        // 
        concepts.add(conceptRoleRequest);
    }
    // 
    if (!concepts.isEmpty()) {
        IdmRoleRequestDto roleRequest = (IdmRoleRequestDto) event.getProperties().get(IdentityContractUpdateByAutomaticRoleProcessor.EVENT_PROPERTY_REQUEST);
        if (roleRequest != null) {
            // add concept into single request
            // single request will be executed by parent event
            roleRequest.getConceptRoles().addAll(concepts);
        } else {
            // execute new request
            roleRequest = new IdmRoleRequestDto();
            roleRequest.setConceptRoles(concepts);
            roleRequest.setApplicant(contract.getIdentity());
            roleRequest = roleRequestService.startConcepts(new RoleRequestEvent(RoleRequestEventType.EXCECUTE, roleRequest), event);
        }
        event.getProperties().put(IdentityContractUpdateByAutomaticRoleProcessor.EVENT_PROPERTY_REQUEST, roleRequest);
    }
    // 
    return new DefaultEventResult<>(event, this);
}
Also used : AbstractIdmAutomaticRoleDto(eu.bcvsolutions.idm.core.api.dto.AbstractIdmAutomaticRoleDto) DtoUtils(eu.bcvsolutions.idm.core.api.utils.DtoUtils) IdmIdentityRole_(eu.bcvsolutions.idm.core.model.entity.IdmIdentityRole_) IdmRoleTreeNodeService(eu.bcvsolutions.idm.core.api.service.IdmRoleTreeNodeService) IdmIdentityRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto) Autowired(org.springframework.beans.factory.annotation.Autowired) CoreEventProcessor(eu.bcvsolutions.idm.core.api.event.CoreEventProcessor) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) AutomaticRoleManager(eu.bcvsolutions.idm.core.api.service.AutomaticRoleManager) IdmRoleRequestService(eu.bcvsolutions.idm.core.api.service.IdmRoleRequestService) EntityStateManager(eu.bcvsolutions.idm.core.api.service.EntityStateManager) IdmConceptRoleRequestDto(eu.bcvsolutions.idm.core.api.dto.IdmConceptRoleRequestDto) DefaultEventResult(eu.bcvsolutions.idm.core.api.event.DefaultEventResult) EventResult(eu.bcvsolutions.idm.core.api.event.EventResult) IdmContractPosition_(eu.bcvsolutions.idm.core.model.entity.IdmContractPosition_) IdmIdentityContractDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto) EntityEvent(eu.bcvsolutions.idm.core.api.event.EntityEvent) Description(org.springframework.context.annotation.Description) IdmIdentityRoleService(eu.bcvsolutions.idm.core.api.service.IdmIdentityRoleService) Iterator(java.util.Iterator) ContractPositionEventType(eu.bcvsolutions.idm.core.model.event.ContractPositionEvent.ContractPositionEventType) IdmRoleRequestDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleRequestDto) Set(java.util.Set) OperationState(eu.bcvsolutions.idm.core.api.domain.OperationState) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) Objects(java.util.Objects) IdmContractPositionDto(eu.bcvsolutions.idm.core.api.dto.IdmContractPositionDto) IdmRoleTreeNodeDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleTreeNodeDto) List(java.util.List) Component(org.springframework.stereotype.Component) CoreResultCode(eu.bcvsolutions.idm.core.api.domain.CoreResultCode) RoleRequestEvent(eu.bcvsolutions.idm.core.model.event.RoleRequestEvent) RoleRequestEventType(eu.bcvsolutions.idm.core.model.event.RoleRequestEvent.RoleRequestEventType) ContractPositionProcessor(eu.bcvsolutions.idm.core.api.event.processor.ContractPositionProcessor) ConceptRoleRequestOperation(eu.bcvsolutions.idm.core.api.domain.ConceptRoleRequestOperation) IdmRoleTreeNodeDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleTreeNodeDto) IdmContractPositionDto(eu.bcvsolutions.idm.core.api.dto.IdmContractPositionDto) ArrayList(java.util.ArrayList) RoleRequestEvent(eu.bcvsolutions.idm.core.model.event.RoleRequestEvent) DefaultEventResult(eu.bcvsolutions.idm.core.api.event.DefaultEventResult) AbstractIdmAutomaticRoleDto(eu.bcvsolutions.idm.core.api.dto.AbstractIdmAutomaticRoleDto) IdmConceptRoleRequestDto(eu.bcvsolutions.idm.core.api.dto.IdmConceptRoleRequestDto) UUID(java.util.UUID) IdmIdentityRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto) IdmIdentityContractDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto) IdmRoleRequestDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleRequestDto) HashSet(java.util.HashSet)

Example 22 with IdmContractPositionDto

use of eu.bcvsolutions.idm.core.api.dto.IdmContractPositionDto in project CzechIdMng by bcvsolutions.

the class IdentityContractUpdateByAutomaticRoleProcessor method process.

@Override
public EventResult<IdmIdentityContractDto> process(EntityEvent<IdmIdentityContractDto> event) {
    IdmIdentityContractDto contract = event.getContent();
    IdmIdentityContractDto previous = event.getOriginalSource();
    UUID previousPosition = previous == null ? null : previous.getWorkPosition();
    UUID newPosition = contract.getWorkPosition();
    boolean validityChangedToValid = previous == null ? false : contract.isValidNowOrInFuture() && previous.isValidNowOrInFuture() != contract.isValidNowOrInFuture();
    IdmRoleRequestDto roleRequest = new IdmRoleRequestDto();
    // flag can be processed afterwards
    if (getBooleanProperty(AutomaticRoleManager.SKIP_RECALCULATION, event.getProperties())) {
        LOG.debug("Automatic roles are skipped for contract [{}], state [{}] " + "for position will be created only.", contract.getId(), CoreResultCode.AUTOMATIC_ROLE_SKIPPED.getCode());
        // 
        Map<String, Serializable> properties = new HashMap<>();
        // original contract as property
        properties.put(EntityEvent.EVENT_PROPERTY_ORIGINAL_SOURCE, event.getOriginalSource());
        entityStateManager.createState(contract, OperationState.BLOCKED, contract.isValidNowOrInFuture() ? CoreResultCode.AUTOMATIC_ROLE_SKIPPED : CoreResultCode.AUTOMATIC_ROLE_SKIPPED_INVALID_CONTRACT, properties);
        // 
        return new DefaultEventResult<>(event, this);
    }
    if (!contract.isValidNowOrInFuture()) {
        // but we need to add skipped flag above, even when invalid contract is updated
        return new DefaultEventResult<>(event, this);
    }
    // 
    if (previous == null || !Objects.equals(newPosition, previousPosition) || validityChangedToValid) {
        // work positions has some difference or validity changes
        List<IdmIdentityRoleDto> assignedRoles = getAssignedAutomaticRoles(contract.getId());
        // remove all automatic roles by attribute and by other contract position
        if (!assignedRoles.isEmpty()) {
            assignedRoles = assignedRoles.stream().filter(autoRole -> {
                // remove automatic roles by attribute - solved by different process
                AbstractIdmAutomaticRoleDto automaticRoleDto = DtoUtils.getEmbedded(autoRole, IdmIdentityRole_.automaticRole, (AbstractIdmAutomaticRoleDto) null);
                if (automaticRoleDto instanceof IdmRoleTreeNodeDto) {
                    return true;
                }
                return false;
            }).filter(identityRole -> {
                // remove automatic roles by attribute - solved by different process
                return identityRole.getContractPosition() == null;
            }).collect(Collectors.toList());
        }
        // 
        Set<UUID> previousAutomaticRoles = assignedRoles.stream().filter(identityRole -> {
            return identityRole.getAutomaticRole() != null;
        }).map(identityRole -> {
            return identityRole.getAutomaticRole();
        }).collect(Collectors.toSet());
        Set<IdmRoleTreeNodeDto> addedAutomaticRoles = new HashSet<>();
        if (newPosition != null && contract.isValidNowOrInFuture()) {
            addedAutomaticRoles = roleTreeNodeService.getAutomaticRolesByTreeNode(newPosition);
        }
        // prevent to remove newly added or still exists roles
        Set<UUID> removedAutomaticRoles = new HashSet<>(previousAutomaticRoles);
        removedAutomaticRoles.removeAll(addedAutomaticRoles.stream().map(IdmRoleTreeNodeDto::getId).collect(Collectors.toList()));
        addedAutomaticRoles.removeIf(a -> {
            return previousAutomaticRoles.contains(a.getId());
        });
        // 
        for (UUID removedAutomaticRole : removedAutomaticRoles) {
            Iterator<IdmIdentityRoleDto> iter = assignedRoles.iterator();
            while (iter.hasNext()) {
                IdmIdentityRoleDto identityRole = iter.next();
                if (Objects.equals(identityRole.getAutomaticRole(), removedAutomaticRole)) {
                    // check, if role will be added by new automatic roles and prevent removing
                    IdmRoleTreeNodeDto addedAutomaticRole = getByRole(identityRole.getRole(), addedAutomaticRoles);
                    if (addedAutomaticRole == null) {
                        // remove assigned role
                        IdmConceptRoleRequestDto conceptRoleRequest = new IdmConceptRoleRequestDto();
                        conceptRoleRequest.setIdentityRole(identityRole.getId());
                        conceptRoleRequest.setRole(identityRole.getRole());
                        conceptRoleRequest.setOperation(ConceptRoleRequestOperation.REMOVE);
                        // 
                        roleRequest.getConceptRoles().add(conceptRoleRequest);
                        iter.remove();
                    } else {
                        // change relation only
                        IdmConceptRoleRequestDto conceptRoleRequest = new IdmConceptRoleRequestDto();
                        conceptRoleRequest.setIdentityRole(identityRole.getId());
                        conceptRoleRequest.setAutomaticRole(addedAutomaticRole.getId());
                        conceptRoleRequest.setIdentityContract(contract.getId());
                        conceptRoleRequest.setValidFrom(contract.getValidFrom());
                        conceptRoleRequest.setValidTill(contract.getValidTill());
                        conceptRoleRequest.setRole(identityRole.getRole());
                        conceptRoleRequest.setOperation(ConceptRoleRequestOperation.UPDATE);
                        // 
                        roleRequest.getConceptRoles().add(conceptRoleRequest);
                        // 
                        // new automatic role is not needed
                        addedAutomaticRoles.remove(addedAutomaticRole);
                    }
                }
            }
        }
        // change date - for unchanged assigned roles only
        if (previous != null && EntityUtils.validableChanged(previous, contract)) {
            roleRequest.getConceptRoles().addAll(changeValidable(contract, assignedRoles));
        }
        // add identity roles
        for (AbstractIdmAutomaticRoleDto autoRole : addedAutomaticRoles) {
            IdmConceptRoleRequestDto conceptRoleRequest = new IdmConceptRoleRequestDto();
            conceptRoleRequest.setIdentityContract(contract.getId());
            conceptRoleRequest.setValidFrom(contract.getValidFrom());
            conceptRoleRequest.setValidTill(contract.getValidTill());
            conceptRoleRequest.setRole(autoRole.getRole());
            conceptRoleRequest.setAutomaticRole(autoRole.getId());
            conceptRoleRequest.setOperation(ConceptRoleRequestOperation.ADD);
            // 
            roleRequest.getConceptRoles().add(conceptRoleRequest);
        }
        // contract is enabled => process all contract positions
        if (validityChangedToValid) {
            IdmContractPositionFilter filter = new IdmContractPositionFilter();
            filter.setIdentityContractId(contract.getId());
            // 
            for (IdmContractPositionDto position : contractPositionService.find(filter, null).getContent()) {
                CoreEvent<IdmContractPositionDto> positionEvent = new CoreEvent<>(CoreEventType.NOTIFY, position);
                // we don't need the second asynchronicity
                positionEvent.setPriority(PriorityType.IMMEDIATE);
                positionEvent.getProperties().put(EVENT_PROPERTY_REQUEST, roleRequest);
                // recount automatic roles for given position
                EventContext<IdmContractPositionDto> context = contractPositionService.publish(positionEvent, event);
                // get modified prepared request
                if (context.getLastResult() != null) {
                    roleRequest = (IdmRoleRequestDto) context.getLastResult().getEvent().getProperties().get(EVENT_PROPERTY_REQUEST);
                }
            }
        }
    } else if (previous != null && EntityUtils.validableChanged(previous, contract)) {
        // process validable change only
        roleRequest.getConceptRoles().addAll(changeValidable(contract, getAssignedAutomaticRoles(contract.getId())));
    }
    // start request at end asynchronously
    roleRequest.setApplicant(contract.getIdentity());
    RoleRequestEvent requestEvent = new RoleRequestEvent(RoleRequestEventType.EXCECUTE, roleRequest);
    roleRequestService.startConcepts(requestEvent, event);
    // 
    return new DefaultEventResult<>(event, this);
}
Also used : IdmContractPositionService(eu.bcvsolutions.idm.core.api.service.IdmContractPositionService) AbstractIdmAutomaticRoleDto(eu.bcvsolutions.idm.core.api.dto.AbstractIdmAutomaticRoleDto) DtoUtils(eu.bcvsolutions.idm.core.api.utils.DtoUtils) IdmIdentityRole_(eu.bcvsolutions.idm.core.model.entity.IdmIdentityRole_) IdmRoleTreeNodeService(eu.bcvsolutions.idm.core.api.service.IdmRoleTreeNodeService) IdmIdentityRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto) Autowired(org.springframework.beans.factory.annotation.Autowired) HashMap(java.util.HashMap) CoreEventProcessor(eu.bcvsolutions.idm.core.api.event.CoreEventProcessor) IdentityContractProcessor(eu.bcvsolutions.idm.core.api.event.processor.IdentityContractProcessor) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) AutomaticRoleManager(eu.bcvsolutions.idm.core.api.service.AutomaticRoleManager) CoreEvent(eu.bcvsolutions.idm.core.api.event.CoreEvent) IdmRoleRequestService(eu.bcvsolutions.idm.core.api.service.IdmRoleRequestService) EntityStateManager(eu.bcvsolutions.idm.core.api.service.EntityStateManager) IdmContractPositionFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmContractPositionFilter) EntityUtils(eu.bcvsolutions.idm.core.api.utils.EntityUtils) Map(java.util.Map) IdmConceptRoleRequestDto(eu.bcvsolutions.idm.core.api.dto.IdmConceptRoleRequestDto) DefaultEventResult(eu.bcvsolutions.idm.core.api.event.DefaultEventResult) EventResult(eu.bcvsolutions.idm.core.api.event.EventResult) IdmIdentityContractDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto) EntityEvent(eu.bcvsolutions.idm.core.api.event.EntityEvent) Description(org.springframework.context.annotation.Description) IdmIdentityRoleService(eu.bcvsolutions.idm.core.api.service.IdmIdentityRoleService) Iterator(java.util.Iterator) IdmIdentityRoleFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmIdentityRoleFilter) IdmRoleRequestDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleRequestDto) IdentityContractEventType(eu.bcvsolutions.idm.core.model.event.IdentityContractEvent.IdentityContractEventType) Set(java.util.Set) OperationState(eu.bcvsolutions.idm.core.api.domain.OperationState) RoleRequestState(eu.bcvsolutions.idm.core.api.domain.RoleRequestState) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) EventContext(eu.bcvsolutions.idm.core.api.event.EventContext) PriorityType(eu.bcvsolutions.idm.core.api.domain.PriorityType) Serializable(java.io.Serializable) Objects(java.util.Objects) IdmContractPositionDto(eu.bcvsolutions.idm.core.api.dto.IdmContractPositionDto) IdmRoleTreeNodeDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleTreeNodeDto) List(java.util.List) Component(org.springframework.stereotype.Component) CoreResultCode(eu.bcvsolutions.idm.core.api.domain.CoreResultCode) RoleRequestEvent(eu.bcvsolutions.idm.core.model.event.RoleRequestEvent) CoreEventType(eu.bcvsolutions.idm.core.api.event.CoreEvent.CoreEventType) RoleRequestEventType(eu.bcvsolutions.idm.core.model.event.RoleRequestEvent.RoleRequestEventType) ConceptRoleRequestOperation(eu.bcvsolutions.idm.core.api.domain.ConceptRoleRequestOperation) Serializable(java.io.Serializable) IdmRoleTreeNodeDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleTreeNodeDto) HashMap(java.util.HashMap) IdmContractPositionDto(eu.bcvsolutions.idm.core.api.dto.IdmContractPositionDto) DefaultEventResult(eu.bcvsolutions.idm.core.api.event.DefaultEventResult) IdmConceptRoleRequestDto(eu.bcvsolutions.idm.core.api.dto.IdmConceptRoleRequestDto) UUID(java.util.UUID) HashSet(java.util.HashSet) RoleRequestEvent(eu.bcvsolutions.idm.core.model.event.RoleRequestEvent) IdmContractPositionFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmContractPositionFilter) CoreEvent(eu.bcvsolutions.idm.core.api.event.CoreEvent) AbstractIdmAutomaticRoleDto(eu.bcvsolutions.idm.core.api.dto.AbstractIdmAutomaticRoleDto) IdmIdentityRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto) IdmIdentityContractDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto) IdmRoleRequestDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleRequestDto)

Example 23 with IdmContractPositionDto

use of eu.bcvsolutions.idm.core.api.dto.IdmContractPositionDto in project CzechIdMng by bcvsolutions.

the class IdmContractPositionControllerRestTest method prepareDto.

@Override
protected IdmContractPositionDto prepareDto() {
    IdmContractPositionDto dto = new IdmContractPositionDto();
    dto.setIdentityContract(getHelper().getPrimeContract(getHelper().createIdentity().getId()).getId());
    dto.setWorkPosition(getHelper().createTreeNode().getId());
    dto.setPosition(getHelper().createName());
    return dto;
}
Also used : IdmContractPositionDto(eu.bcvsolutions.idm.core.api.dto.IdmContractPositionDto)

Example 24 with IdmContractPositionDto

use of eu.bcvsolutions.idm.core.api.dto.IdmContractPositionDto in project CzechIdMng by bcvsolutions.

the class ContractPositionProvisioningProcessor method process.

@Override
public EventResult<IdmContractPositionDto> process(EntityEvent<IdmContractPositionDto> event) {
    IdmContractPositionDto contractPositionDto = event.getContent();
    Assert.notNull(contractPositionDto, "Contract position cannot be null!");
    Assert.notNull(contractPositionDto.getIdentityContract(), "Id of contract cannot be null!");
    UUID identityId = null;
    IdmIdentityContractDto contractDto = DtoUtils.getEmbedded(contractPositionDto, IdmContractPosition_.identityContract.getName(), IdmIdentityContractDto.class, (IdmIdentityContractDto) null);
    if (contractDto == null) {
        contractDto = identityContractService.get(contractPositionDto.getIdentityContract());
    }
    identityId = contractDto.getIdentity();
    Assert.notNull(identityId, "Identity ID cannot be null!");
    doProvisioning(identityId, event);
    return new DefaultEventResult<>(event, this);
}
Also used : IdmContractPositionDto(eu.bcvsolutions.idm.core.api.dto.IdmContractPositionDto) DefaultEventResult(eu.bcvsolutions.idm.core.api.event.DefaultEventResult) UUID(java.util.UUID) IdmIdentityContractDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto)

Example 25 with IdmContractPositionDto

use of eu.bcvsolutions.idm.core.api.dto.IdmContractPositionDto in project CzechIdMng by bcvsolutions.

the class DefaultIdentityProjectionManagerIntegrationTest method testSaveAndGetFullProjectionGreenLine.

@Test
@Transactional
public void testSaveAndGetFullProjectionGreenLine() {
    // role request implementer is needed
    loginAsAdmin();
    Assert.assertFalse(eventConfiguration.isAsynchronous());
    // 
    try {
        // prepare eav definition
        IdmFormAttributeDto attributeOne = new IdmFormAttributeDto(getHelper().createName());
        attributeOne.setPersistentType(PersistentType.SHORTTEXT);
        IdmFormAttributeDto attributeTwo = new IdmFormAttributeDto(getHelper().createName());
        attributeTwo.setPersistentType(PersistentType.SHORTTEXT);
        IdmFormDefinitionDto formDefinitionOne = formService.createDefinition(IdmIdentityDto.class, getHelper().createName(), Lists.newArrayList(attributeOne, attributeTwo));
        attributeOne = formDefinitionOne.getMappedAttributeByCode(attributeOne.getCode());
        attributeTwo = formDefinitionOne.getMappedAttributeByCode(attributeTwo.getCode());
        IdmFormAttributeDto attributeThree = new IdmFormAttributeDto(getHelper().createName());
        attributeThree.setPersistentType(PersistentType.SHORTTEXT);
        IdmFormDefinitionDto formDefinitionTwo = formService.createDefinition(IdmIdentityDto.class, getHelper().createName(), Lists.newArrayList(attributeThree));
        attributeThree = formDefinitionTwo.getMappedAttributeByCode(attributeThree.getCode());
        IdmFormAttributeDto attributeContract = new IdmFormAttributeDto(getHelper().createName());
        attributeContract.setPersistentType(PersistentType.SHORTTEXT);
        IdmFormDefinitionDto formDefinitionContract = formService.createDefinition(IdmIdentityContractDto.class, getHelper().createName(), Lists.newArrayList(attributeContract));
        attributeContract = formDefinitionContract.getMappedAttributeByCode(attributeContract.getCode());
        // 
        IdmIdentityDto identity = new IdmIdentityDto(getHelper().createName());
        IdmIdentityProjectionDto projection = new IdmIdentityProjectionDto(identity);
        // 
        // set eav
        IdmFormInstanceDto instanceOne = new IdmFormInstanceDto();
        instanceOne.setFormDefinition(formDefinitionOne);
        IdmFormValueDto valueOne = new IdmFormValueDto(attributeOne);
        valueOne.setValue(getHelper().createName());
        IdmFormValueDto valueTwo = new IdmFormValueDto(attributeTwo);
        valueTwo.setValue(getHelper().createName());
        instanceOne.setValues(Lists.newArrayList(valueOne, valueTwo));
        IdmFormInstanceDto instanceTwo = new IdmFormInstanceDto();
        instanceTwo.setFormDefinition(formDefinitionTwo);
        IdmFormValueDto valueThree = new IdmFormValueDto(attributeThree);
        valueThree.setValue(getHelper().createName());
        instanceTwo.setValues(Lists.newArrayList(valueThree));
        identity.setEavs(Lists.newArrayList(instanceOne, instanceTwo));
        // 
        // set contract
        IdmIdentityContractDto primeContract = new IdmIdentityContractDto();
        primeContract.setMain(true);
        primeContract.setWorkPosition(getHelper().createTreeNode().getId());
        primeContract.setPosition(getHelper().createName());
        primeContract.setValidFrom(LocalDate.now().minus(1l, ChronoUnit.DAYS));
        primeContract.setValidFrom(LocalDate.now().plus(1l, ChronoUnit.DAYS));
        projection.setContract(primeContract);
        IdmFormInstanceDto instanceContract = new IdmFormInstanceDto();
        instanceContract.setFormDefinition(formDefinitionContract);
        IdmFormValueDto valueContract = new IdmFormValueDto(attributeContract);
        valueContract.setValue(getHelper().createName());
        instanceContract.setValues(Lists.newArrayList(valueContract));
        primeContract.setEavs(Lists.newArrayList(instanceContract));
        // 
        // set other contract
        IdmIdentityContractDto otherContractOne = new IdmIdentityContractDto();
        otherContractOne.setWorkPosition(getHelper().createTreeNode().getId());
        otherContractOne.setPosition(getHelper().createName());
        // preset uuid
        IdmIdentityContractDto otherContractTwo = new IdmIdentityContractDto(UUID.randomUUID());
        otherContractTwo.setWorkPosition(getHelper().createTreeNode().getId());
        otherContractTwo.setPosition(getHelper().createName());
        projection.setOtherContracts(Lists.newArrayList(otherContractOne, otherContractTwo));
        // 
        // set other contract position
        IdmContractPositionDto positionOne = new IdmContractPositionDto();
        positionOne.setWorkPosition(getHelper().createTreeNode().getId());
        positionOne.setPosition(getHelper().createName());
        IdmContractPositionDto positionTwo = new IdmContractPositionDto();
        positionTwo.setWorkPosition(getHelper().createTreeNode().getId());
        positionTwo.setPosition(getHelper().createName());
        positionTwo.setIdentityContract(otherContractTwo.getId());
        projection.setOtherPositions(Lists.newArrayList(positionOne, positionTwo));
        // 
        // set assigned roles
        IdmRoleDto roleOne = getHelper().createRole();
        IdmRoleDto roleTwo = getHelper().createRole();
        IdmIdentityRoleDto identityRoleOne = new IdmIdentityRoleDto();
        identityRoleOne.setRole(roleOne.getId());
        identityRoleOne.setValidFrom(LocalDate.now().plus(2l, ChronoUnit.DAYS));
        IdmIdentityRoleDto identityRoleTwo = new IdmIdentityRoleDto();
        identityRoleTwo.setRole(roleTwo.getId());
        identityRoleTwo.setIdentityContract(otherContractTwo.getId());
        projection.setIdentityRoles(Lists.newArrayList(identityRoleOne, identityRoleTwo));
        // 
        IdentityProjectionEvent identityProjectionEvent = new IdentityProjectionEvent(IdentityProjectionEventType.CREATE, projection);
        identityProjectionEvent.setPriority(PriorityType.IMMEDIATE);
        projection = manager.publish(identityProjectionEvent).getContent();
        IdmIdentityProjectionDto createdProjection = manager.get(projection);
        // 
        Assert.assertNotNull(createdProjection);
        Assert.assertNotNull(createdProjection.getId());
        Assert.assertEquals(createdProjection.getId(), createdProjection.getIdentity().getId());
        // eavs
        Assert.assertEquals(valueOne.getValue(), createdProjection.getIdentity().getEavs().stream().filter(i -> i.getFormDefinition().getId().equals(formDefinitionOne.getId())).findFirst().get().toSinglePersistentValue(attributeOne.getCode()));
        Assert.assertEquals(valueTwo.getValue(), createdProjection.getIdentity().getEavs().stream().filter(i -> i.getFormDefinition().getId().equals(formDefinitionOne.getId())).findFirst().get().toSinglePersistentValue(attributeTwo.getCode()));
        Assert.assertEquals(valueThree.getValue(), createdProjection.getIdentity().getEavs().stream().filter(i -> i.getFormDefinition().getId().equals(formDefinitionTwo.getId())).findFirst().get().toSinglePersistentValue(attributeThree.getCode()));
        // prime contract
        IdmIdentityContractDto createdPrimeContract = createdProjection.getContract();
        Assert.assertEquals(primeContract.getWorkPosition(), createdPrimeContract.getWorkPosition());
        Assert.assertEquals(primeContract.getPosition(), createdPrimeContract.getPosition());
        Assert.assertEquals(primeContract.getValidFrom(), createdPrimeContract.getValidFrom());
        Assert.assertEquals(primeContract.getValidTill(), createdPrimeContract.getValidTill());
        Assert.assertEquals(createdProjection.getIdentity().getId(), createdPrimeContract.getIdentity());
        // eavs
        Assert.assertEquals(valueContract.getValue(), createdProjection.getContract().getEavs().stream().filter(i -> i.getFormDefinition().getId().equals(formDefinitionContract.getId())).findFirst().get().toSinglePersistentValue(attributeContract.getCode()));
        // other contract
        Assert.assertEquals(2, createdProjection.getOtherContracts().size());
        Assert.assertTrue(createdProjection.getOtherContracts().stream().anyMatch(c -> {
            return c.getWorkPosition().equals(otherContractOne.getWorkPosition()) && c.getPosition().equals(otherContractOne.getPosition());
        }));
        Assert.assertTrue(createdProjection.getOtherContracts().stream().anyMatch(c -> {
            return c.getWorkPosition().equals(otherContractTwo.getWorkPosition()) && c.getPosition().equals(otherContractTwo.getPosition()) && // preserve id
            c.getId().equals(otherContractTwo.getId());
        }));
        // other position
        Assert.assertEquals(2, createdProjection.getOtherPositions().size());
        Assert.assertTrue(createdProjection.getOtherPositions().stream().anyMatch(p -> {
            return p.getWorkPosition().equals(positionOne.getWorkPosition()) && p.getPosition().equals(positionOne.getPosition()) && p.getIdentityContract().equals(createdPrimeContract.getId());
        }));
        Assert.assertTrue(createdProjection.getOtherPositions().stream().anyMatch(p -> {
            return p.getWorkPosition().equals(positionTwo.getWorkPosition()) && p.getPosition().equals(positionTwo.getPosition()) && p.getIdentityContract().equals(positionTwo.getIdentityContract());
        }));
        // assigned roles
        // check directly by service
        IdmRoleRequestFilter roleRequestFilter = new IdmRoleRequestFilter();
        roleRequestFilter.setApplicantId(createdProjection.getIdentity().getId());
        List<IdmRoleRequestDto> roleRequests = roleRequestService.find(roleRequestFilter, null).getContent();
        Assert.assertFalse(roleRequests.isEmpty());
        Assert.assertTrue(roleRequests.stream().allMatch(r -> r.getState() == RoleRequestState.EXECUTED));
        List<IdmIdentityRoleDto> assignedRoles = identityRoleService.findAllByIdentity(createdProjection.getIdentity().getId());
        Assert.assertEquals(2, assignedRoles.size());
        Assert.assertTrue(assignedRoles.stream().anyMatch(ir -> {
            return ir.getRole().equals(roleOne.getId()) && ir.getValidFrom().equals(identityRoleOne.getValidFrom()) && ir.getIdentityContract().equals(createdPrimeContract.getId());
        }));
        Assert.assertTrue(assignedRoles.stream().anyMatch(ir -> {
            return ir.getRole().equals(roleTwo.getId()) && ir.getIdentityContract().equals(otherContractTwo.getId());
        }));
        // check by projection
        Assert.assertEquals(2, createdProjection.getIdentityRoles().size());
        Assert.assertTrue(createdProjection.getIdentityRoles().stream().anyMatch(ir -> {
            return ir.getRole().equals(roleOne.getId()) && ir.getValidFrom().equals(identityRoleOne.getValidFrom()) && ir.getIdentityContract().equals(createdPrimeContract.getId());
        }));
        Assert.assertTrue(createdProjection.getIdentityRoles().stream().anyMatch(ir -> {
            return ir.getRole().equals(roleTwo.getId()) && ir.getIdentityContract().equals(otherContractTwo.getId());
        }));
        // 
        // simple update
        String newUsername = getHelper().createName();
        createdProjection.getIdentity().setUsername(newUsername);
        // 
        IdmIdentityProjectionDto updatedProjection = manager.publish(new IdentityProjectionEvent(IdentityProjectionEventType.UPDATE, createdProjection)).getContent();
        // IdmIdentityProjectionDto updatedProjection = manager.get(projection);
        // 
        Assert.assertNotNull(updatedProjection);
        Assert.assertNotNull(updatedProjection.getId());
        Assert.assertEquals(createdProjection.getId(), updatedProjection.getIdentity().getId());
        Assert.assertEquals(newUsername, updatedProjection.getIdentity().getUsername());
        // eavs
        Assert.assertEquals(valueOne.getValue(), updatedProjection.getIdentity().getEavs().stream().filter(i -> i.getFormDefinition().getId().equals(formDefinitionOne.getId())).findFirst().get().toSinglePersistentValue(attributeOne.getCode()));
        Assert.assertEquals(valueTwo.getValue(), updatedProjection.getIdentity().getEavs().stream().filter(i -> i.getFormDefinition().getId().equals(formDefinitionOne.getId())).findFirst().get().toSinglePersistentValue(attributeTwo.getCode()));
        Assert.assertEquals(valueThree.getValue(), updatedProjection.getIdentity().getEavs().stream().filter(i -> i.getFormDefinition().getId().equals(formDefinitionTwo.getId())).findFirst().get().toSinglePersistentValue(attributeThree.getCode()));
        // prime contract
        IdmIdentityContractDto updatedPrimeContract = updatedProjection.getContract();
        Assert.assertEquals(primeContract.getWorkPosition(), updatedPrimeContract.getWorkPosition());
        Assert.assertEquals(primeContract.getPosition(), updatedPrimeContract.getPosition());
        Assert.assertEquals(primeContract.getValidFrom(), updatedPrimeContract.getValidFrom());
        Assert.assertEquals(primeContract.getValidTill(), updatedPrimeContract.getValidTill());
        Assert.assertEquals(updatedProjection.getIdentity().getId(), updatedPrimeContract.getIdentity());
        Assert.assertFalse(updatedPrimeContract.getControlledBySlices());
        // other contract
        Assert.assertEquals(2, updatedProjection.getOtherContracts().size());
        Assert.assertTrue(updatedProjection.getOtherContracts().stream().anyMatch(c -> {
            return c.getWorkPosition().equals(otherContractOne.getWorkPosition()) && c.getPosition().equals(otherContractOne.getPosition());
        }));
        Assert.assertTrue(updatedProjection.getOtherContracts().stream().anyMatch(c -> {
            return c.getWorkPosition().equals(otherContractTwo.getWorkPosition()) && c.getPosition().equals(otherContractTwo.getPosition()) && // preserve id
            c.getId().equals(otherContractTwo.getId());
        }));
        Assert.assertTrue(updatedProjection.getOtherContracts().stream().allMatch(c -> {
            return !c.getControlledBySlices();
        }));
        // other position
        Assert.assertEquals(2, updatedProjection.getOtherPositions().size());
        Assert.assertTrue(updatedProjection.getOtherPositions().stream().anyMatch(p -> {
            return p.getWorkPosition().equals(positionOne.getWorkPosition()) && p.getPosition().equals(positionOne.getPosition()) && p.getIdentityContract().equals(updatedPrimeContract.getId());
        }));
        Assert.assertTrue(updatedProjection.getOtherPositions().stream().anyMatch(p -> {
            return p.getWorkPosition().equals(positionTwo.getWorkPosition()) && p.getPosition().equals(positionTwo.getPosition()) && p.getIdentityContract().equals(positionTwo.getIdentityContract());
        }));
        // assigned roles
        Assert.assertEquals(2, updatedProjection.getIdentityRoles().size());
        Assert.assertTrue(updatedProjection.getIdentityRoles().stream().anyMatch(ir -> {
            return ir.getRole().equals(roleOne.getId()) && ir.getValidFrom().equals(identityRoleOne.getValidFrom()) && ir.getIdentityContract().equals(updatedPrimeContract.getId());
        }));
        Assert.assertTrue(updatedProjection.getIdentityRoles().stream().anyMatch(ir -> {
            return ir.getRole().equals(roleTwo.getId()) && ir.getIdentityContract().equals(otherContractTwo.getId());
        }));
    } finally {
        logout();
    }
}
Also used : IdmFormInstanceDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormInstanceDto) Lists(org.testng.collections.Lists) IdmIdentityRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto) IdmFormAttributeDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormAttributeDto) IdmIdentityContract(eu.bcvsolutions.idm.core.model.entity.IdmIdentityContract) Autowired(org.springframework.beans.factory.annotation.Autowired) FormService(eu.bcvsolutions.idm.core.eav.api.service.FormService) ForbiddenEntityException(eu.bcvsolutions.idm.core.api.exception.ForbiddenEntityException) BigDecimal(java.math.BigDecimal) IdmAutomaticRoleAttributeDto(eu.bcvsolutions.idm.core.api.dto.IdmAutomaticRoleAttributeDto) IdmRoleRequestService(eu.bcvsolutions.idm.core.api.service.IdmRoleRequestService) CoreGroupPermission(eu.bcvsolutions.idm.core.model.domain.CoreGroupPermission) IdmFormValueDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormValueDto) SecurityMockMvcRequestPostProcessors.authentication(org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.authentication) IdmIdentityFormValue(eu.bcvsolutions.idm.core.model.entity.eav.IdmIdentityFormValue) IdmIdentityProjectionDto(eu.bcvsolutions.idm.core.api.dto.projection.IdmIdentityProjectionDto) AutomaticRoleAttributeRuleType(eu.bcvsolutions.idm.core.api.domain.AutomaticRoleAttributeRuleType) IdmIdentity(eu.bcvsolutions.idm.core.model.entity.IdmIdentity) IdmIdentityContractService(eu.bcvsolutions.idm.core.api.service.IdmIdentityContractService) IdmRoleRequestDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleRequestDto) IdmFormProjectionDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormProjectionDto) UUID(java.util.UUID) RoleConfiguration(eu.bcvsolutions.idm.core.api.config.domain.RoleConfiguration) PriorityType(eu.bcvsolutions.idm.core.api.domain.PriorityType) InvalidFormException(eu.bcvsolutions.idm.core.api.exception.InvalidFormException) IdmContractPositionDto(eu.bcvsolutions.idm.core.api.dto.IdmContractPositionDto) List(java.util.List) EventConfiguration(eu.bcvsolutions.idm.core.api.config.domain.EventConfiguration) LocalDate(java.time.LocalDate) IdmRoleRequestFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmRoleRequestFilter) IdmIdentityService(eu.bcvsolutions.idm.core.api.service.IdmIdentityService) GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString) MockMvcResultMatchers.content(org.springframework.test.web.servlet.result.MockMvcResultMatchers.content) PersistentType(eu.bcvsolutions.idm.core.eav.api.domain.PersistentType) IdmBasePermission(eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission) LookupService(eu.bcvsolutions.idm.core.api.service.LookupService) MockMvcResultMatchers.status(org.springframework.test.web.servlet.result.MockMvcResultMatchers.status) MockMvcRequestBuilders.post(org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post) IdmFormProjectionService(eu.bcvsolutions.idm.core.eav.api.service.IdmFormProjectionService) TestHelper(eu.bcvsolutions.idm.test.api.TestHelper) AbstractRestTest(eu.bcvsolutions.idm.test.api.AbstractRestTest) IdmFormInstanceDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormInstanceDto) IdmIdentityContractDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto) Before(org.junit.Before) IdmIdentityRoleService(eu.bcvsolutions.idm.core.api.service.IdmIdentityRoleService) IdentityProjectionEventType(eu.bcvsolutions.idm.core.eav.api.event.IdentityProjectionEvent.IdentityProjectionEventType) IdentityFormValueEvaluator(eu.bcvsolutions.idm.core.security.evaluator.eav.IdentityFormValueEvaluator) IdmIdentityRoleFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmIdentityRoleFilter) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) IdentityProjectionEvent(eu.bcvsolutions.idm.core.eav.api.event.IdentityProjectionEvent) Test(org.junit.Test) RoleRequestState(eu.bcvsolutions.idm.core.api.domain.RoleRequestState) ApplicationContext(org.springframework.context.ApplicationContext) IdmIdentityContract_(eu.bcvsolutions.idm.core.model.entity.IdmIdentityContract_) ConfigurationMap(eu.bcvsolutions.idm.core.api.domain.ConfigurationMap) IdmFormDefinitionDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto) ChronoUnit(java.time.temporal.ChronoUnit) IdmRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleDto) SelfIdentityEvaluator(eu.bcvsolutions.idm.core.security.evaluator.identity.SelfIdentityEvaluator) AutomaticRoleAttributeRuleComparison(eu.bcvsolutions.idm.core.api.domain.AutomaticRoleAttributeRuleComparison) MockMvcRequestBuilders.get(org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get) BaseController(eu.bcvsolutions.idm.core.api.rest.BaseController) IdmIdentity_(eu.bcvsolutions.idm.core.model.entity.IdmIdentity_) Assert(org.junit.Assert) Transactional(org.springframework.transaction.annotation.Transactional) FormDefinitionAttributes(eu.bcvsolutions.idm.core.eav.api.dto.FormDefinitionAttributes) IdmRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleDto) IdmContractPositionDto(eu.bcvsolutions.idm.core.api.dto.IdmContractPositionDto) IdmFormDefinitionDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto) GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString) IdmIdentityProjectionDto(eu.bcvsolutions.idm.core.api.dto.projection.IdmIdentityProjectionDto) IdmFormAttributeDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormAttributeDto) IdmFormValueDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormValueDto) IdentityProjectionEvent(eu.bcvsolutions.idm.core.eav.api.event.IdentityProjectionEvent) IdmRoleRequestFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmRoleRequestFilter) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) IdmIdentityRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto) IdmIdentityContractDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto) IdmRoleRequestDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleRequestDto) AbstractRestTest(eu.bcvsolutions.idm.test.api.AbstractRestTest) Test(org.junit.Test) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

IdmContractPositionDto (eu.bcvsolutions.idm.core.api.dto.IdmContractPositionDto)40 IdmIdentityContractDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto)37 IdmIdentityDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto)30 Test (org.junit.Test)29 IdmRoleDto (eu.bcvsolutions.idm.core.api.dto.IdmRoleDto)22 IdmIdentityRoleDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto)21 IdmTreeNodeDto (eu.bcvsolutions.idm.core.api.dto.IdmTreeNodeDto)18 AbstractIntegrationTest (eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)18 IdmRoleTreeNodeDto (eu.bcvsolutions.idm.core.api.dto.IdmRoleTreeNodeDto)14 Transactional (org.springframework.transaction.annotation.Transactional)14 IdmContractPositionFilter (eu.bcvsolutions.idm.core.api.dto.filter.IdmContractPositionFilter)12 UUID (java.util.UUID)10 GuardedString (eu.bcvsolutions.idm.core.security.api.domain.GuardedString)9 List (java.util.List)9 Autowired (org.springframework.beans.factory.annotation.Autowired)9 IdmTreeTypeDto (eu.bcvsolutions.idm.core.api.dto.IdmTreeTypeDto)7 EntityEvent (eu.bcvsolutions.idm.core.api.event.EntityEvent)6 IdmIdentityContractService (eu.bcvsolutions.idm.core.api.service.IdmIdentityContractService)6 IdmIdentityRoleService (eu.bcvsolutions.idm.core.api.service.IdmIdentityRoleService)6 CoreResultCode (eu.bcvsolutions.idm.core.api.domain.CoreResultCode)5