Search in sources :

Example 1 with IdmRoleRequestByIdentityDto

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

the class DefaultIdmRoleRequestServiceIntegrationTest method testCopyRolesWithParameterAttachment.

@Test
@Transactional
public void testCopyRolesWithParameterAttachment() {
    long countBefore = attachmentManager.find(null).getTotalElements();
    String attributeCode = "attr-" + System.currentTimeMillis();
    // Prepare identity, role and parameters
    IdmIdentityDto identity = getHelper().createIdentity((GuardedString) null);
    IdmRoleDto role = getHelper().createRole();
    IdmFormAttributeDto attribute = new IdmFormAttributeDto(attributeCode);
    attribute.setPersistentType(PersistentType.ATTACHMENT);
    IdmFormDefinitionDto definition = formService.createDefinition(IdmIdentityRole.class, FormService.DEFAULT_DEFINITION_CODE, ImmutableList.of(attribute));
    role.setIdentityRoleAttributeDefinition(definition.getId());
    role = roleService.save(role);
    final IdmRoleDto roleFinal = role;
    definition.getFormAttributes().forEach(attr -> {
        roleFormAttributeService.addAttributeToSubdefintion(roleFinal, attr);
    });
    attribute = formService.getAttribute(definition, attributeCode);
    assertNotNull(attribute);
    IdmIdentityContractDto identityContact = getHelper().createContract(identity);
    IdmIdentityRoleDto identityRoleDto = this.getHelper().createIdentityRole(identityContact, role);
    // Add attachment to identity role
    String originalContent = "test-content-" + System.currentTimeMillis();
    IdmAttachmentDto attachment = prepareAttachment(originalContent);
    attachment.setOwnerType(AttachmentManager.TEMPORARY_ATTACHMENT_OWNER_TYPE);
    attachment = attachmentManager.saveAttachment(null, attachment);
    List<IdmFormInstanceDto> eavs = identityRoleDto.getEavs();
    IdmFormInstanceDto formInstanceDto = eavs.get(0);
    IdmFormValueDto newValue = new IdmFormValueDto(attribute);
    newValue.setShortTextValue(attachment.getName());
    newValue.setUuidValue(attachment.getId());
    formInstanceDto.setValues(Lists.newArrayList(newValue));
    identityRoleDto.setEavs(Lists.newArrayList(formInstanceDto));
    identityRoleDto = identityRoleService.save(identityRoleDto);
    IdmFormInstanceDto identityRoleValues = identityRoleService.getRoleAttributeValues(identityRoleDto);
    identityRoleValues = identityRoleService.getRoleAttributeValues(identityRoleDto);
    List<IdmFormValueDto> values = identityRoleValues.getValues();
    assertEquals(1, values.size());
    IdmFormValueDto originalValue = values.get(0);
    // Assign roles by identity
    IdmIdentityDto identityDto = this.getHelper().createIdentity((GuardedString) null);
    List<IdmIdentityRoleDto> allByIdentity = identityRoleService.findAllByIdentity(identity.getId());
    List<UUID> identityRolesId = allByIdentity.stream().map(IdmIdentityRoleDto::getId).collect(Collectors.toList());
    IdmIdentityContractDto identityContractDto = getHelper().createContract(identityDto);
    IdmRoleRequestDto createdRequest = roleRequestService.createRequest(identityContractDto);
    IdmRoleRequestByIdentityDto requestByIdentityDto = new IdmRoleRequestByIdentityDto();
    requestByIdentityDto.setIdentityContract(identityContractDto.getId());
    requestByIdentityDto.setRoleRequest(createdRequest.getId());
    requestByIdentityDto.setIdentityRoles(identityRolesId);
    requestByIdentityDto.setCopyRoleParameters(true);
    IdmRoleRequestDto copyRolesByIdentity = roleRequestService.copyRolesByIdentity(requestByIdentityDto);
    List<IdmConceptRoleRequestDto> concepts = conceptRoleRequestService.findAllByRoleRequest(copyRolesByIdentity.getId());
    assertEquals(1, concepts.size());
    IdmConceptRoleRequestDto concept = concepts.stream().filter(cntp -> {
        return cntp.getRole().equals(roleFinal.getId());
    }).findAny().orElse(null);
    assertNotNull(concept);
    IdmFormInstanceDto formInstance = conceptRoleRequestService.getRoleAttributeValues(concept, false);
    values = formInstance.getValues();
    assertEquals(1, values.size());
    IdmFormValueDto copyValue = values.get(0);
    assertEquals(originalValue.getPersistentType(), copyValue.getPersistentType());
    assertEquals(originalValue.getFormAttribute(), copyValue.getFormAttribute());
    assertNotEquals(originalValue.getUuidValue(), copyValue.getUuidValue());
    assertEquals(countBefore + 2, attachmentManager.find(null).getTotalElements());
}
Also used : IdmAttachmentDto(eu.bcvsolutions.idm.core.ecm.api.dto.IdmAttachmentDto) IdmFormInstanceDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormInstanceDto) IdmRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleDto) IdmFormDefinitionDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto) GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString) IdmRoleRequestByIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleRequestByIdentityDto) IdmFormAttributeDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormAttributeDto) IdmFormValueDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormValueDto) IdmConceptRoleRequestDto(eu.bcvsolutions.idm.core.api.dto.IdmConceptRoleRequestDto) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) IdmIdentityRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto) UUID(java.util.UUID) IdmIdentityContractDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto) IdmRoleRequestDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleRequestDto) AbstractCoreWorkflowIntegrationTest(eu.bcvsolutions.idm.core.AbstractCoreWorkflowIntegrationTest) Test(org.junit.Test) Transactional(org.springframework.transaction.annotation.Transactional)

Example 2 with IdmRoleRequestByIdentityDto

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

the class DefaultIdmRoleRequestServiceIntegrationTest method testCopyRolesWithParametersWithoutValues.

@Test
@Transactional
public void testCopyRolesWithParametersWithoutValues() {
    String attributeOneCode = "attr-" + System.currentTimeMillis();
    String attributeTwoCode = "attr-two-" + System.currentTimeMillis();
    String attributeThreeCode = "attr-three-" + System.currentTimeMillis();
    // Prepare identity, role and parameters
    IdmIdentityDto identity = getHelper().createIdentity((GuardedString) null);
    IdmRoleDto roleOne = getHelper().createRole();
    IdmRoleDto roleTwo = getHelper().createRole();
    IdmFormAttributeDto attributeOne = new IdmFormAttributeDto(attributeOneCode);
    attributeOne.setPersistentType(PersistentType.SHORTTEXT);
    attributeOne.setRequired(false);
    IdmFormAttributeDto attributeTwo = new IdmFormAttributeDto(attributeTwoCode);
    attributeTwo.setPersistentType(PersistentType.SHORTTEXT);
    attributeTwo.setRequired(false);
    IdmFormAttributeDto attributeThree = new IdmFormAttributeDto(attributeThreeCode);
    attributeThree.setPersistentType(PersistentType.SHORTTEXT);
    attributeThree.setRequired(true);
    IdmFormDefinitionDto definition = formService.createDefinition(IdmIdentityRole.class, FormService.DEFAULT_DEFINITION_CODE, ImmutableList.of(attributeOne, attributeTwo, attributeThree));
    roleOne.setIdentityRoleAttributeDefinition(definition.getId());
    roleOne = roleService.save(roleOne);
    IdmRoleDto roleOneFinal = roleOne;
    definition.getFormAttributes().forEach(attribute -> {
        if (!attributeThreeCode.equals(attribute.getCode())) {
            roleFormAttributeService.addAttributeToSubdefintion(roleOneFinal, attribute);
        }
    });
    IdmIdentityContractDto identityContact = getHelper().createContract(identity);
    this.getHelper().createIdentityRole(identityContact, roleOne);
    this.getHelper().createIdentityRole(identityContact, roleTwo);
    // Assign roles by identity
    IdmIdentityDto identityDto = this.getHelper().createIdentity((GuardedString) null);
    List<IdmIdentityRoleDto> allByIdentity = identityRoleService.findAllByIdentity(identity.getId());
    List<UUID> identityRolesId = allByIdentity.stream().map(IdmIdentityRoleDto::getId).collect(Collectors.toList());
    IdmIdentityContractDto identityContractDto = getHelper().createContract(identityDto);
    IdmRoleRequestDto createdRequest = roleRequestService.createRequest(identityContractDto);
    IdmRoleRequestByIdentityDto requestByIdentityDto = new IdmRoleRequestByIdentityDto();
    requestByIdentityDto.setIdentityContract(identityContractDto.getId());
    requestByIdentityDto.setRoleRequest(createdRequest.getId());
    requestByIdentityDto.setIdentityRoles(identityRolesId);
    requestByIdentityDto.setCopyRoleParameters(true);
    IdmRoleRequestDto copyRolesByIdentity = roleRequestService.copyRolesByIdentity(requestByIdentityDto);
    List<IdmConceptRoleRequestDto> concepts = conceptRoleRequestService.findAllByRoleRequest(copyRolesByIdentity.getId());
    assertEquals(2, concepts.size());
    UUID roleOneId = roleOne.getId();
    IdmConceptRoleRequestDto conceptOne = concepts.stream().filter(concept -> {
        return concept.getRole().equals(roleOneId);
    }).findAny().orElse(null);
    assertNotNull(conceptOne);
    IdmConceptRoleRequestDto conceptTwo = concepts.stream().filter(concept -> {
        return concept.getRole().equals(roleTwo.getId());
    }).findAny().orElse(null);
    assertNotNull(conceptTwo);
    IdmFormInstanceDto formInstanceOne = conceptRoleRequestService.getRoleAttributeValues(conceptOne, false);
    IdmFormInstanceDto formInstanceTwo = conceptRoleRequestService.getRoleAttributeValues(conceptTwo, false);
    assertNotNull(formInstanceOne);
    assertTrue(formInstanceOne.getValues().isEmpty());
    assertNull(formInstanceTwo);
}
Also used : IdmFormInstanceDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormInstanceDto) IdmRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleDto) IdmFormDefinitionDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto) GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString) IdmRoleRequestByIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleRequestByIdentityDto) IdmFormAttributeDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormAttributeDto) IdmConceptRoleRequestDto(eu.bcvsolutions.idm.core.api.dto.IdmConceptRoleRequestDto) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) IdmIdentityRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto) UUID(java.util.UUID) IdmIdentityContractDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto) IdmRoleRequestDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleRequestDto) AbstractCoreWorkflowIntegrationTest(eu.bcvsolutions.idm.core.AbstractCoreWorkflowIntegrationTest) Test(org.junit.Test) Transactional(org.springframework.transaction.annotation.Transactional)

Example 3 with IdmRoleRequestByIdentityDto

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

the class DefaultIdmRoleRequestServiceIntegrationTest method testCopyRolesByIdentityWithoutTestTransaction.

@Test
public void testCopyRolesByIdentityWithoutTestTransaction() {
    IdmIdentityDto identity = getHelper().createIdentity((GuardedString) null);
    IdmRoleDto role = this.getHelper().createRole();
    for (int i = 0; i < 21; i++) {
        this.getHelper().createIdentityRole(identity, role);
    }
    List<IdmIdentityRoleDto> assignedRoles = identityRoleService.findAllByIdentity(identity.getId());
    Assert.assertEquals(21, assignedRoles.size());
    List<UUID> identityRolesId = assignedRoles.stream().map(IdmIdentityRoleDto::getId).collect(Collectors.toList());
    IdmIdentityDto identityCopy = this.getHelper().createIdentity((GuardedString) null);
    IdmIdentityContractDto contractCopy = getHelper().getPrimeContract(identityCopy);
    IdmRoleRequestDto createdRequest = roleRequestService.createRequest(contractCopy);
    IdmRoleRequestByIdentityDto requestByIdentityDto = new IdmRoleRequestByIdentityDto();
    requestByIdentityDto.setIdentityContract(contractCopy.getId());
    requestByIdentityDto.setIdentityRoles(identityRolesId);
    requestByIdentityDto.setRoleRequest(createdRequest.getId());
    IdmRoleRequestDto copyRolesByIdentity = roleRequestService.copyRolesByIdentity(requestByIdentityDto);
    Assert.assertNotNull(copyRolesByIdentity);
    List<IdmConceptRoleRequestDto> concepts = conceptRoleRequestService.findAllByRoleRequest(copyRolesByIdentity.getId());
    assertEquals(21, concepts.size());
}
Also used : IdmRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleDto) IdmConceptRoleRequestDto(eu.bcvsolutions.idm.core.api.dto.IdmConceptRoleRequestDto) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) IdmIdentityRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto) UUID(java.util.UUID) IdmIdentityContractDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto) IdmRoleRequestDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleRequestDto) IdmRoleRequestByIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleRequestByIdentityDto) AbstractCoreWorkflowIntegrationTest(eu.bcvsolutions.idm.core.AbstractCoreWorkflowIntegrationTest) Test(org.junit.Test)

Example 4 with IdmRoleRequestByIdentityDto

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

the class DefaultIdmRoleRequestServiceIntegrationTest method testCopyRolesByIdentity.

@Test
@Transactional
public void testCopyRolesByIdentity() {
    IdmIdentityDto identityDto = this.getHelper().createIdentity((GuardedString) null);
    IdmRoleDto roleOne = this.getHelper().createRole();
    IdmRoleDto roleTwo = this.getHelper().createRole();
    IdmIdentityContractDto primeContract = this.getHelper().getPrimeContract(identityDto);
    this.getHelper().createIdentityRole(primeContract, roleOne);
    this.getHelper().createIdentityRole(primeContract, roleTwo);
    List<IdmIdentityRoleDto> allByIdentity = identityRoleService.findAllByIdentity(identityDto.getId());
    List<UUID> identityRolesId = allByIdentity.stream().map(IdmIdentityRoleDto::getId).collect(Collectors.toList());
    IdmIdentityDto newIdentity = this.getHelper().createIdentity((GuardedString) null);
    IdmIdentityContractDto newIdentityContract = this.getHelper().getPrimeContract(newIdentity);
    IdmRoleRequestDto createdRequest = roleRequestService.createRequest(newIdentityContract);
    IdmRoleRequestByIdentityDto requestByIdentityDto = new IdmRoleRequestByIdentityDto();
    requestByIdentityDto.setIdentityContract(newIdentityContract.getId());
    requestByIdentityDto.setIdentityRoles(identityRolesId);
    requestByIdentityDto.setRoleRequest(createdRequest.getId());
    IdmRoleRequestDto copyRolesByIdentity = roleRequestService.copyRolesByIdentity(requestByIdentityDto);
    assertNotNull(copyRolesByIdentity);
    assertEquals(createdRequest.getId(), copyRolesByIdentity.getId());
    List<IdmConceptRoleRequestDto> concepts = conceptRoleRequestService.findAllByRoleRequest(copyRolesByIdentity.getId());
    assertEquals(2, concepts.size());
    IdmConceptRoleRequestDto conceptOne = concepts.stream().filter(concept -> {
        return concept.getRole().equals(roleOne.getId());
    }).findAny().orElse(null);
    assertNotNull(conceptOne);
    IdmConceptRoleRequestDto conceptTwo = concepts.stream().filter(concept -> {
        return concept.getRole().equals(roleTwo.getId());
    }).findAny().orElse(null);
    assertNotNull(conceptTwo);
}
Also used : IdmRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleDto) IdmConceptRoleRequestDto(eu.bcvsolutions.idm.core.api.dto.IdmConceptRoleRequestDto) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) IdmIdentityRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto) UUID(java.util.UUID) IdmIdentityContractDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto) IdmRoleRequestDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleRequestDto) IdmRoleRequestByIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleRequestByIdentityDto) AbstractCoreWorkflowIntegrationTest(eu.bcvsolutions.idm.core.AbstractCoreWorkflowIntegrationTest) Test(org.junit.Test) Transactional(org.springframework.transaction.annotation.Transactional)

Example 5 with IdmRoleRequestByIdentityDto

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

the class DefaultIdmRoleRequestServiceIntegrationTest method testCopyRolesWithParameters.

@Test
@Transactional
public void testCopyRolesWithParameters() {
    String attributeOneCode = "attr-" + System.currentTimeMillis();
    String attributeOneDefaultValue = "test-one-" + System.currentTimeMillis();
    String attributeTwoCode = "attr-two-" + System.currentTimeMillis();
    String attributeTwoDefaultValue = "test-" + System.currentTimeMillis();
    // Prepare identity, role and parameters
    IdmIdentityDto identity = getHelper().createIdentity((GuardedString) null);
    IdmRoleDto roleOne = getHelper().createRole();
    IdmRoleDto roleTwo = getHelper().createRole();
    IdmFormAttributeDto attributeOne = new IdmFormAttributeDto(attributeOneCode);
    attributeOne.setPersistentType(PersistentType.SHORTTEXT);
    attributeOne.setRequired(true);
    attributeOne.setDefaultValue(attributeOneDefaultValue);
    IdmFormAttributeDto attributeTwo = new IdmFormAttributeDto(attributeTwoCode);
    attributeTwo.setPersistentType(PersistentType.SHORTTEXT);
    attributeTwo.setRequired(true);
    attributeTwo.setDefaultValue(attributeTwoDefaultValue);
    IdmFormDefinitionDto definition = formService.createDefinition(IdmIdentityRole.class, FormService.DEFAULT_DEFINITION_CODE, ImmutableList.of(attributeOne, attributeTwo));
    roleOne.setIdentityRoleAttributeDefinition(definition.getId());
    roleOne = roleService.save(roleOne);
    IdmRoleDto roleOneFinal = roleOne;
    definition.getFormAttributes().forEach(attribute -> {
        roleFormAttributeService.addAttributeToSubdefintion(roleOneFinal, attribute);
    });
    IdmIdentityContractDto identityContact = getHelper().createContract(identity);
    this.getHelper().createIdentityRole(identityContact, roleOne);
    this.getHelper().createIdentityRole(identityContact, roleTwo);
    // Assign roles by identity
    IdmIdentityDto identityDto = this.getHelper().createIdentity((GuardedString) null);
    List<IdmIdentityRoleDto> allByIdentity = identityRoleService.findAllByIdentity(identity.getId());
    List<UUID> identityRolesId = allByIdentity.stream().map(IdmIdentityRoleDto::getId).collect(Collectors.toList());
    IdmIdentityContractDto identityContractDto = getHelper().createContract(identityDto);
    IdmRoleRequestDto createdRequest = roleRequestService.createRequest(identityContractDto);
    IdmRoleRequestByIdentityDto requestByIdentityDto = new IdmRoleRequestByIdentityDto();
    requestByIdentityDto.setIdentityContract(identityContractDto.getId());
    requestByIdentityDto.setRoleRequest(createdRequest.getId());
    requestByIdentityDto.setIdentityRoles(identityRolesId);
    requestByIdentityDto.setCopyRoleParameters(true);
    IdmRoleRequestDto copyRolesByIdentity = roleRequestService.copyRolesByIdentity(requestByIdentityDto);
    List<IdmConceptRoleRequestDto> concepts = conceptRoleRequestService.findAllByRoleRequest(copyRolesByIdentity.getId());
    assertEquals(2, concepts.size());
    UUID roleOneId = roleOne.getId();
    IdmConceptRoleRequestDto conceptOne = concepts.stream().filter(concept -> {
        return concept.getRole().equals(roleOneId);
    }).findAny().orElse(null);
    assertNotNull(conceptOne);
    IdmConceptRoleRequestDto conceptTwo = concepts.stream().filter(concept -> {
        return concept.getRole().equals(roleTwo.getId());
    }).findAny().orElse(null);
    assertNotNull(conceptTwo);
    IdmFormInstanceDto formInstanceOne = conceptRoleRequestService.getRoleAttributeValues(conceptOne, false);
    IdmFormInstanceDto formInstanceTwo = conceptRoleRequestService.getRoleAttributeValues(conceptTwo, false);
    assertNotNull(formInstanceOne);
    assertNull(formInstanceTwo);
    assertEquals(2, formInstanceOne.getValues().size());
    attributeOne = definition.getFormAttributes().stream().filter(att -> {
        return att.getCode().equals(attributeOneCode);
    }).findFirst().orElse(null);
    attributeTwo = definition.getFormAttributes().stream().filter(att -> {
        return att.getCode().equals(attributeTwoCode);
    }).findFirst().orElse(null);
    assertNotNull(attributeOne);
    assertNotNull(attributeTwo);
    UUID attributeOneId = attributeOne.getId();
    IdmFormValueDto valueDto = formInstanceOne.getValues().stream().filter(value -> {
        return value.getFormAttribute().equals(attributeOneId);
    }).findFirst().orElse(null);
    assertNotNull(valueDto);
    assertEquals(attributeOneDefaultValue, valueDto.getValue());
    UUID attributeTwoId = attributeTwo.getId();
    valueDto = formInstanceOne.getValues().stream().filter(value -> {
        return value.getFormAttribute().equals(attributeTwoId);
    }).findFirst().orElse(null);
    assertNotNull(valueDto);
    assertEquals(attributeTwoDefaultValue, valueDto.getValue());
}
Also used : IdmFormInstanceDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormInstanceDto) IdmRoleRequestByIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleRequestByIdentityDto) IdmConceptRoleRequestService(eu.bcvsolutions.idm.core.api.service.IdmConceptRoleRequestService) IdmRequestIdentityRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmRequestIdentityRoleDto) IdmIdentityRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto) IdmFormAttributeDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormAttributeDto) RoleRequestException(eu.bcvsolutions.idm.core.api.exception.RoleRequestException) Autowired(org.springframework.beans.factory.annotation.Autowired) FormService(eu.bcvsolutions.idm.core.eav.api.service.FormService) 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) IdmRequestIdentityRoleService(eu.bcvsolutions.idm.core.api.service.IdmRequestIdentityRoleService) Map(java.util.Map) After(org.junit.After) ModuleService(eu.bcvsolutions.idm.core.api.service.ModuleService) SecurityContextHolder(org.springframework.security.core.context.SecurityContextHolder) IdmIdentityContractService(eu.bcvsolutions.idm.core.api.service.IdmIdentityContractService) Collection(java.util.Collection) IdmRoleRequestDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleRequestDto) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) PriorityType(eu.bcvsolutions.idm.core.api.domain.PriorityType) Serializable(java.io.Serializable) GrantedAuthority(org.springframework.security.core.GrantedAuthority) IOUtils(org.apache.commons.io.IOUtils) 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) RoleRequestEventType(eu.bcvsolutions.idm.core.model.event.RoleRequestEvent.RoleRequestEventType) RoleRequestApprovalProcessor(eu.bcvsolutions.idm.core.model.event.processor.role.RoleRequestApprovalProcessor) GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString) IdmAttachmentDto(eu.bcvsolutions.idm.core.ecm.api.dto.IdmAttachmentDto) FutureTask(java.util.concurrent.FutureTask) RoleRequestedByType(eu.bcvsolutions.idm.core.api.domain.RoleRequestedByType) HashMap(java.util.HashMap) IdmJwtAuthentication(eu.bcvsolutions.idm.core.security.api.domain.IdmJwtAuthentication) PersistentType(eu.bcvsolutions.idm.core.eav.api.domain.PersistentType) Lists(com.google.common.collect.Lists) IdmIdentityRole(eu.bcvsolutions.idm.core.model.entity.IdmIdentityRole) IdmAuthorityUtils(eu.bcvsolutions.idm.core.security.api.utils.IdmAuthorityUtils) ImmutableList(com.google.common.collect.ImmutableList) AbstractCoreWorkflowIntegrationTest(eu.bcvsolutions.idm.core.AbstractCoreWorkflowIntegrationTest) IdmConceptRoleRequestDto(eu.bcvsolutions.idm.core.api.dto.IdmConceptRoleRequestDto) Qualifier(org.springframework.beans.factory.annotation.Qualifier) 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) SchedulerConfiguration(eu.bcvsolutions.idm.core.scheduler.api.config.SchedulerConfiguration) IdmIdentityRoleFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmIdentityRoleFilter) Executor(java.util.concurrent.Executor) Assert.assertNotNull(org.junit.Assert.assertNotNull) AttachmentManager(eu.bcvsolutions.idm.core.ecm.api.service.AttachmentManager) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) IdmRoleService(eu.bcvsolutions.idm.core.api.service.IdmRoleService) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) RoleRequestState(eu.bcvsolutions.idm.core.api.domain.RoleRequestState) Assert.assertNotEquals(org.junit.Assert.assertNotEquals) IdmRoleFormAttributeService(eu.bcvsolutions.idm.core.api.service.IdmRoleFormAttributeService) IdmFormDefinitionDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto) Assert.assertNull(org.junit.Assert.assertNull) IdmRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleDto) RoleRequestEvent(eu.bcvsolutions.idm.core.model.event.RoleRequestEvent) IdmRequestIdentityRoleFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmRequestIdentityRoleFilter) IdmGroupPermission(eu.bcvsolutions.idm.core.security.api.domain.IdmGroupPermission) Assert(org.junit.Assert) ConceptRoleRequestOperation(eu.bcvsolutions.idm.core.api.domain.ConceptRoleRequestOperation) Assert.assertEquals(org.junit.Assert.assertEquals) Transactional(org.springframework.transaction.annotation.Transactional) IdmRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleDto) IdmFormDefinitionDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto) GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString) IdmRoleRequestByIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleRequestByIdentityDto) IdmFormAttributeDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormAttributeDto) IdmConceptRoleRequestDto(eu.bcvsolutions.idm.core.api.dto.IdmConceptRoleRequestDto) IdmFormValueDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormValueDto) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) IdmIdentityRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto) UUID(java.util.UUID) IdmIdentityContractDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto) IdmRoleRequestDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleRequestDto) AbstractCoreWorkflowIntegrationTest(eu.bcvsolutions.idm.core.AbstractCoreWorkflowIntegrationTest) Test(org.junit.Test) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

AbstractCoreWorkflowIntegrationTest (eu.bcvsolutions.idm.core.AbstractCoreWorkflowIntegrationTest)6 IdmConceptRoleRequestDto (eu.bcvsolutions.idm.core.api.dto.IdmConceptRoleRequestDto)6 IdmIdentityContractDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto)6 IdmIdentityDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto)6 IdmIdentityRoleDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto)6 IdmRoleDto (eu.bcvsolutions.idm.core.api.dto.IdmRoleDto)6 IdmRoleRequestByIdentityDto (eu.bcvsolutions.idm.core.api.dto.IdmRoleRequestByIdentityDto)6 IdmRoleRequestDto (eu.bcvsolutions.idm.core.api.dto.IdmRoleRequestDto)6 UUID (java.util.UUID)6 Test (org.junit.Test)6 Transactional (org.springframework.transaction.annotation.Transactional)5 IdmFormAttributeDto (eu.bcvsolutions.idm.core.eav.api.dto.IdmFormAttributeDto)3 IdmFormDefinitionDto (eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto)3 IdmFormInstanceDto (eu.bcvsolutions.idm.core.eav.api.dto.IdmFormInstanceDto)3 IdmFormValueDto (eu.bcvsolutions.idm.core.eav.api.dto.IdmFormValueDto)2 IdmAttachmentDto (eu.bcvsolutions.idm.core.ecm.api.dto.IdmAttachmentDto)2 GuardedString (eu.bcvsolutions.idm.core.security.api.domain.GuardedString)2 LocalDate (java.time.LocalDate)2 ImmutableList (com.google.common.collect.ImmutableList)1 Lists (com.google.common.collect.Lists)1