Search in sources :

Example 1 with FormDefinitionAttributes

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

the class DefaultFormService method toValueFilter.

/**
 * Construct value filter for find form values.
 *
 * @param ownerEntity owner
 * @param formDefinition form definition
 * @param filter only some attributes can be found only
 * @return
 * @since 10.3.0
 */
protected IdmFormValueFilter<FormableEntity> toValueFilter(FormableEntity ownerEntity, IdmFormDefinitionDto formDefinition, FormableFilter filter) {
    IdmFormValueFilter<FormableEntity> valueFilter = new IdmFormValueFilter<>();
    valueFilter.setOwner(ownerEntity);
    valueFilter.setDefinitionId(formDefinition.getId());
    valueFilter.setAddSecredProxyString(true);
    if (filter == null) {
        // filter is not given => all attributes
        return valueFilter;
    }
    // 
    // apply formable filter with given parameters
    List<FormDefinitionAttributes> formDefinitionAttributes = filter.getFormDefinitionAttributes();
    if (CollectionUtils.isEmpty(formDefinitionAttributes)) {
        // filter is given, but empty  => all attributes
        return valueFilter;
    }
    // 
    UUID formDefinitionId = formDefinition.getId();
    FormDefinitionAttributes attributes = formDefinitionAttributes.stream().filter(a -> formDefinitionId.equals(a.getDefinition())).findFirst().orElse(null);
    if (attributes == null) {
        // filter is given, but without processed definition  => all attributes
        return valueFilter;
    }
    // 
    List<UUID> attributeIds = attributes.getAttributes();
    if (CollectionUtils.isEmpty(attributeIds)) {
        // filter for processed definition is given, but without attributes  => all attributes
        return valueFilter;
    }
    // set attributes by filter
    valueFilter.setAttributeIds(attributes.getAttributes());
    // 
    return valueFilter;
}
Also used : IdmFormValueFilter(eu.bcvsolutions.idm.core.eav.api.dto.filter.IdmFormValueFilter) UUID(java.util.UUID) FormableEntity(eu.bcvsolutions.idm.core.eav.api.entity.FormableEntity) FormDefinitionAttributes(eu.bcvsolutions.idm.core.eav.api.dto.FormDefinitionAttributes)

Example 2 with FormDefinitionAttributes

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

the class DefaultFormService method findFormInstances.

@Override
@Transactional(readOnly = true)
public List<IdmFormInstanceDto> findFormInstances(Identifiable owner, FormableFilter filter, BasePermission... permission) {
    Assert.notNull(owner, "Form values owner is required.");
    // 
    // filter form definitions and form attributes, if given
    List<IdmFormDefinitionDto> formDefinitions;
    if (filter == null || CollectionUtils.isEmpty(filter.getFormDefinitionAttributes())) {
        // filter is not set => all form definitions
        formDefinitions = getDefinitions(owner, !PermissionUtils.isEmpty(permission) ? IdmBasePermission.AUTOCOMPLETE : null);
    } else {
        // used filter definitions only.
        IdmFormDefinitionFilter definitionFilter = new IdmFormDefinitionFilter();
        definitionFilter.setType(getDefaultDefinitionType(owner.getClass()));
        definitionFilter.setIds(filter.getFormDefinitionAttributes().stream().map(FormDefinitionAttributes::getDefinition).collect(Collectors.toList()));
        // 
        formDefinitions = formDefinitionService.find(definitionFilter, getDefinitionPageable(), !PermissionUtils.isEmpty(permission) ? IdmBasePermission.AUTOCOMPLETE : null).getContent();
    }
    // 
    return formDefinitions.stream().map(definition -> {
        return findFormInstance(owner, definition, filter, permission);
    }).collect(Collectors.toList());
}
Also used : AbstractFormValue_(eu.bcvsolutions.idm.core.eav.entity.AbstractFormValue_) Order(org.springframework.data.domain.Sort.Order) DtoUtils(eu.bcvsolutions.idm.core.api.utils.DtoUtils) ZonedDateTime(java.time.ZonedDateTime) IdmFormAttributeDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormAttributeDto) PluginRegistry(org.springframework.plugin.core.PluginRegistry) FormProjectionManager(eu.bcvsolutions.idm.core.eav.api.service.FormProjectionManager) Autowired(org.springframework.beans.factory.annotation.Autowired) FormDefinitionCache(eu.bcvsolutions.idm.core.eav.api.domain.FormDefinitionCache) FormService(eu.bcvsolutions.idm.core.eav.api.service.FormService) StringUtils(org.apache.commons.lang3.StringUtils) BigDecimal(java.math.BigDecimal) CoreEvent(eu.bcvsolutions.idm.core.api.event.CoreEvent) Matcher(java.util.regex.Matcher) IdmFormValueDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormValueDto) ResultCodeException(eu.bcvsolutions.idm.core.api.exception.ResultCodeException) Map(java.util.Map) BasePermission(eu.bcvsolutions.idm.core.security.api.domain.BasePermission) IdmFormAttributeService(eu.bcvsolutions.idm.core.eav.api.service.IdmFormAttributeService) Pageable(org.springframework.data.domain.Pageable) Sort(org.springframework.data.domain.Sort) FormableFilter(eu.bcvsolutions.idm.core.api.dto.filter.FormableFilter) Method(java.lang.reflect.Method) ImmutableMap(com.google.common.collect.ImmutableMap) ConfigurationClassProperty(eu.bcvsolutions.idm.core.api.domain.ConfigurationClassProperty) Set(java.util.Set) PageRequest(org.springframework.data.domain.PageRequest) UUID(java.util.UUID) IdmFormAttributeFilter(eu.bcvsolutions.idm.core.eav.api.dto.filter.IdmFormAttributeFilter) Page(org.springframework.data.domain.Page) Collectors(java.util.stream.Collectors) IntrospectionException(java.beans.IntrospectionException) Serializable(java.io.Serializable) InvocationTargetException(java.lang.reflect.InvocationTargetException) List(java.util.List) PermissionUtils(eu.bcvsolutions.idm.core.security.api.utils.PermissionUtils) PropertyDescriptor(java.beans.PropertyDescriptor) LocalDate(java.time.LocalDate) Entry(java.util.Map.Entry) Identifiable(eu.bcvsolutions.idm.core.api.domain.Identifiable) Lazy(org.springframework.context.annotation.Lazy) Pattern(java.util.regex.Pattern) PageImpl(org.springframework.data.domain.PageImpl) FormableDto(eu.bcvsolutions.idm.core.api.dto.FormableDto) IdmFormAttribute_(eu.bcvsolutions.idm.core.eav.entity.IdmFormAttribute_) FormableEntity(eu.bcvsolutions.idm.core.eav.api.entity.FormableEntity) FormAttributeRendererDto(eu.bcvsolutions.idm.core.eav.api.dto.FormAttributeRendererDto) OrderAwarePluginRegistry(org.springframework.plugin.core.OrderAwarePluginRegistry) IdmAttachmentDto(eu.bcvsolutions.idm.core.ecm.api.dto.IdmAttachmentDto) HashMap(java.util.HashMap) ValueWrapper(eu.bcvsolutions.idm.core.api.config.cache.domain.ValueWrapper) MessageFormat(java.text.MessageFormat) ArrayList(java.util.ArrayList) PersistentType(eu.bcvsolutions.idm.core.eav.api.domain.PersistentType) HashSet(java.util.HashSet) LinkedHashMap(java.util.LinkedHashMap) IdmFormValueFilter(eu.bcvsolutions.idm.core.eav.api.dto.filter.IdmFormValueFilter) Introspector(java.beans.Introspector) IdmBasePermission(eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission) Lists(com.google.common.collect.Lists) LookupService(eu.bcvsolutions.idm.core.api.service.LookupService) CollectionUtils(org.apache.commons.collections.CollectionUtils) EntityUtils(eu.bcvsolutions.idm.core.api.utils.EntityUtils) IdmFormInstanceDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormInstanceDto) IdmExportImportDto(eu.bcvsolutions.idm.core.api.dto.IdmExportImportDto) EntityEvent(eu.bcvsolutions.idm.core.api.event.EntityEvent) ConfigurationClass(eu.bcvsolutions.idm.core.api.domain.ConfigurationClass) IdmFormDefinition_(eu.bcvsolutions.idm.core.eav.entity.IdmFormDefinition_) FormAttributeRenderer(eu.bcvsolutions.idm.core.eav.api.service.FormAttributeRenderer) IdmFormDefinitionFilter(eu.bcvsolutions.idm.core.eav.api.dto.filter.IdmFormDefinitionFilter) CoreException(eu.bcvsolutions.idm.core.api.exception.CoreException) AttachmentManager(eu.bcvsolutions.idm.core.ecm.api.service.AttachmentManager) ObjectUtils(org.springframework.util.ObjectUtils) IdmCacheManager(eu.bcvsolutions.idm.core.api.service.IdmCacheManager) EnabledEvaluator(eu.bcvsolutions.idm.core.security.api.service.EnabledEvaluator) ApplicationContext(org.springframework.context.ApplicationContext) EventContext(eu.bcvsolutions.idm.core.api.event.EventContext) IdmFormDefinitionDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto) ExportDescriptorDto(eu.bcvsolutions.idm.core.api.dto.ExportDescriptorDto) CoreResultCode(eu.bcvsolutions.idm.core.api.domain.CoreResultCode) FormValueService(eu.bcvsolutions.idm.core.eav.api.service.FormValueService) IdmFormDefinitionService(eu.bcvsolutions.idm.core.eav.api.service.IdmFormDefinitionService) IdmForm(eu.bcvsolutions.idm.core.eav.entity.IdmForm) CoreEventType(eu.bcvsolutions.idm.core.api.event.CoreEvent.CoreEventType) BaseDto(eu.bcvsolutions.idm.core.api.dto.BaseDto) Comparator(java.util.Comparator) EntityEventManager(eu.bcvsolutions.idm.core.api.service.EntityEventManager) Transactional(org.springframework.transaction.annotation.Transactional) Assert(org.springframework.util.Assert) FormDefinitionAttributes(eu.bcvsolutions.idm.core.eav.api.dto.FormDefinitionAttributes) InvalidFormAttributeDto(eu.bcvsolutions.idm.core.eav.api.dto.InvalidFormAttributeDto) IdmFormDefinitionFilter(eu.bcvsolutions.idm.core.eav.api.dto.filter.IdmFormDefinitionFilter) IdmFormDefinitionDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto) FormDefinitionAttributes(eu.bcvsolutions.idm.core.eav.api.dto.FormDefinitionAttributes) Transactional(org.springframework.transaction.annotation.Transactional)

Example 3 with FormDefinitionAttributes

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

the class DefaultIdentityProjectionManager method setAddEavMetadata.

/**
 * Load extended attributes, if needed by projection.
 *
 * @param context
 * @param identity
 */
protected void setAddEavMetadata(FormableFilter context, IdmIdentityDto identity) {
    if (identity.getFormProjection() == null) {
        // load all form instances => ~ full form projection as default, when no projection is specified
        context.setAddEavMetadata(Boolean.TRUE);
        return;
    }
    // 
    IdmFormProjectionDto formProjection = lookupService.lookupEmbeddedDto(identity, IdmIdentity_.formProjection);
    String formDefinitions = formProjection.getFormDefinitions();
    if (StringUtils.isEmpty(formDefinitions)) {
        // form instances are not needed - not configured in this projection
        return;
    }
    // 
    try {
        List<FormDefinitionAttributes> attributes = mapper.readValue(formDefinitions, new TypeReference<List<FormDefinitionAttributes>>() {
        });
        if (!attributes.isEmpty()) {
            context.setFormDefinitionAttributes(attributes);
        } else {
            LOG.debug("Extended attribute values is not needed by form projection [{}], will not be loaded.");
        }
    } catch (IOException ex) {
        LOG.warn("Form projection [{}] is wrongly configured. Fix configured form definitions. " + "All eav attributes will be loaded as default.", formProjection.getCode(), ex);
        context.setAddEavMetadata(Boolean.TRUE);
    }
}
Also used : IdmFormProjectionDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormProjectionDto) List(java.util.List) ArrayList(java.util.ArrayList) IOException(java.io.IOException) FormDefinitionAttributes(eu.bcvsolutions.idm.core.eav.api.dto.FormDefinitionAttributes)

Example 4 with FormDefinitionAttributes

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

the class DefaultIdentityProjectionManagerIntegrationTest method testAssignAutomaticRoleIdentityAndContractEav.

@Test
public void testAssignAutomaticRoleIdentityAndContractEav() throws Exception {
    UUID identityId = null;
    try {
        getHelper().enableAsynchronousProcessing();
        // create form definition, roles, automatic role etc.
        IdmRoleDto role = getHelper().createRole();
        IdmRoleDto subRole = getHelper().createRole();
        getHelper().createRoleComposition(role, subRole);
        IdmRoleDto roleContract = getHelper().createRole();
        IdmRoleDto subRoleContract = getHelper().createRole();
        getHelper().createRoleComposition(roleContract, subRoleContract);
        // 
        IdmFormAttributeDto formAttributeOne = new IdmFormAttributeDto(getHelper().createName());
        IdmFormDefinitionDto formDefinition = formService.createDefinition(IdmIdentityDto.class, getHelper().createName(), Lists.newArrayList(formAttributeOne));
        formAttributeOne = formDefinition.getMappedAttributeByCode(formAttributeOne.getCode());
        // 
        IdmFormAttributeDto formAttributeContract = new IdmFormAttributeDto(getHelper().createName());
        IdmFormDefinitionDto formDefinitionContract = formService.createDefinition(IdmIdentityContractDto.class, getHelper().createName(), Lists.newArrayList(formAttributeContract));
        formAttributeContract = formDefinitionContract.getMappedAttributeByCode(formAttributeContract.getCode());
        // 
        IdmAutomaticRoleAttributeDto automaticRole = getHelper().createAutomaticRole(role.getId());
        getHelper().createAutomaticRoleRule(automaticRole.getId(), AutomaticRoleAttributeRuleComparison.EQUALS, AutomaticRoleAttributeRuleType.IDENTITY_EAV, null, formAttributeOne.getId(), "mockOne");
        IdmAutomaticRoleAttributeDto automaticRoleContract = getHelper().createAutomaticRole(roleContract.getId());
        getHelper().createAutomaticRoleRule(automaticRoleContract.getId(), AutomaticRoleAttributeRuleComparison.EQUALS, AutomaticRoleAttributeRuleType.CONTRACT_EAV, null, formAttributeContract.getId(), "mockContract");
        // form projection
        IdmFormProjectionDto formProjection = new IdmFormProjectionDto();
        formProjection.setCode(getHelper().createName());
        formProjection.setOwnerType(lookupService.getOwnerType(IdmIdentityDto.class));
        formProjection.getProperties().put(IdentityFormProjectionRoute.PARAMETER_LOAD_ASSIGNED_ROLES, false);
        formProjection.getProperties().put(IdentityFormProjectionRoute.PARAMETER_ALL_CONTRACTS, true);
        FormDefinitionAttributes attributes = new FormDefinitionAttributes();
        attributes.setDefinition(formDefinition.getId());
        attributes.getAttributes().add(formAttributeOne.getId());
        FormDefinitionAttributes attributesContract = new FormDefinitionAttributes();
        attributesContract.setDefinition(formDefinitionContract.getId());
        attributesContract.getAttributes().add(formAttributeContract.getId());
        formProjection.setCode(getHelper().createName());
        formProjection.setOwnerType(lookupService.getOwnerType(IdmIdentityDto.class));
        formProjection.setFormDefinitions(mapper.writeValueAsString(Lists.newArrayList(attributes, attributesContract)));
        formProjection = projectionService.save(formProjection);
        // 
        // prepare identity projection with two contract
        IdmIdentityDto identity = new IdmIdentityDto(getHelper().createName());
        identity.setFormProjection(formProjection.getId());
        IdmFormValueDto formValue = new IdmFormValueDto(formAttributeOne);
        formValue.setValue("mockOne");
        identity.getEavs().add(new IdmFormInstanceDto(identity, formDefinition, Lists.newArrayList(formValue)));
        IdmIdentityContractDto contractOne = new IdmIdentityContractDto();
        contractOne.setPosition(getHelper().createName());
        IdmIdentityContractDto contractTwo = new IdmIdentityContractDto();
        contractTwo.setPosition(getHelper().createName());
        IdmFormValueDto formValueContract = new IdmFormValueDto(formAttributeContract);
        formValueContract.setValue("mockContract");
        contractTwo.getEavs().add(new IdmFormInstanceDto(contractTwo, formDefinitionContract, Lists.newArrayList(formValueContract)));
        IdmIdentityProjectionDto projection = new IdmIdentityProjectionDto(identity);
        projection.setContract(contractOne);
        projection.setOtherContracts(Lists.newArrayList(contractTwo));
        // 
        // create by projection
        projection = manager.publish(new IdentityProjectionEvent(IdentityProjectionEventType.CREATE, projection)).getContent();
        IdmIdentityProjectionDto createdProjection = manager.get(projection);
        identityId = createdProjection.getIdentity().getId();
        Assert.assertEquals(identity.getUsername(), createdProjection.getIdentity().getUsername());
        IdmIdentityContractDto primeContract = createdProjection.getContract();
        Assert.assertNotNull(primeContract);
        Assert.assertEquals(contractOne.getPosition(), primeContract.getPosition());
        Assert.assertEquals(1, createdProjection.getOtherContracts().size());
        IdmIdentityContractDto otherContract = createdProjection.getOtherContracts().get(0);
        Assert.assertEquals(contractTwo.getPosition(), otherContract.getPosition());
        // 
        // 6 roles
        IdmIdentityRoleFilter filter = new IdmIdentityRoleFilter();
        filter.setIdentityId(createdProjection.getIdentity().getId());
        getHelper().waitForResult(res -> {
            return identityRoleService.find(filter, null).getContent().size() != 6;
        });
        List<IdmIdentityRoleDto> identityRoles = Lists.newArrayList(identityRoleService.find(filter, null).getContent());
        Assert.assertEquals(6, identityRoles.size());
        Assert.assertEquals(2, identityRoles.stream().filter(ir -> ir.getRole().equals(role.getId())).count());
        Assert.assertEquals(2, identityRoles.stream().filter(ir -> ir.getRole().equals(subRole.getId())).count());
        Assert.assertEquals(1, identityRoles.stream().filter(ir -> ir.getRole().equals(roleContract.getId())).count());
        Assert.assertEquals(1, identityRoles.stream().filter(ir -> ir.getRole().equals(subRoleContract.getId())).count());
        // 
        // change eav value => remove all automatic roles
        formValue.setValue("mockUpdate");
        createdProjection.getIdentity().getEavs().clear();
        createdProjection.getIdentity().getEavs().add(new IdmFormInstanceDto(identity, formDefinition, Lists.newArrayList(formValue)));
        manager.publish(new IdentityProjectionEvent(IdentityProjectionEventType.UPDATE, createdProjection)).getContent();
        getHelper().waitForResult(res -> {
            return identityRoleService.find(filter, null).getContent().size() != 2;
        });
        // 
        identityRoles = Lists.newArrayList(identityRoleService.find(filter, null).getContent());
        Assert.assertEquals(2, identityRoles.size());
        Assert.assertEquals(1, identityRoles.stream().filter(ir -> ir.getRole().equals(roleContract.getId())).count());
        Assert.assertEquals(1, identityRoles.stream().filter(ir -> ir.getRole().equals(subRoleContract.getId())).count());
    } finally {
        getHelper().disableAsynchronousProcessing();
        getHelper().deleteIdentity(identityId);
    }
}
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) IdmIdentityRoleFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmIdentityRoleFilter) IdmAutomaticRoleAttributeDto(eu.bcvsolutions.idm.core.api.dto.IdmAutomaticRoleAttributeDto) IdmIdentityProjectionDto(eu.bcvsolutions.idm.core.api.dto.projection.IdmIdentityProjectionDto) IdmFormProjectionDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormProjectionDto) 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) UUID(java.util.UUID) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) IdmIdentityRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto) IdmIdentityContractDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto) FormDefinitionAttributes(eu.bcvsolutions.idm.core.eav.api.dto.FormDefinitionAttributes) AbstractRestTest(eu.bcvsolutions.idm.test.api.AbstractRestTest) Test(org.junit.Test)

Example 5 with FormDefinitionAttributes

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

the class DefaultIdentityProjectionManagerIntegrationTest method testLoadProjectionDefinedEavsOnly.

@Test
@Transactional
public void testLoadProjectionDefinedEavsOnly() throws Exception {
    // 
    // create definition with two attributes
    IdmFormAttributeDto formAttributeOne = new IdmFormAttributeDto(getHelper().createName());
    IdmFormAttributeDto formAttributeTwo = new IdmFormAttributeDto(getHelper().createName());
    IdmFormDefinitionDto formDefinition = formService.createDefinition(IdmIdentityDto.class, getHelper().createName(), Lists.newArrayList(formAttributeOne, formAttributeTwo));
    formAttributeOne = formDefinition.getMappedAttributeByCode(formAttributeOne.getCode());
    formAttributeTwo = formDefinition.getMappedAttributeByCode(formAttributeTwo.getCode());
    // 
    // create projection with one attribute
    FormDefinitionAttributes attributes = new FormDefinitionAttributes();
    attributes.setDefinition(formDefinition.getId());
    attributes.getAttributes().add(formAttributeOne.getId());
    IdmFormProjectionDto projection = new IdmFormProjectionDto();
    projection.setCode(getHelper().createName());
    projection.setOwnerType(lookupService.getOwnerType(IdmIdentityDto.class));
    projection.setFormDefinitions(mapper.writeValueAsString(Lists.newArrayList(attributes)));
    projection = projectionService.save(projection);
    // 
    // create identity with projection is defined
    IdmIdentityDto identity = new IdmIdentityDto(getHelper().createName());
    identity.setFormProjection(projection.getId());
    identity = identityService.save(identity);
    // 
    // save some values
    IdmFormValueDto formValueOne = new IdmFormValueDto(formAttributeOne);
    formValueOne.setValue(getHelper().createName());
    IdmFormValueDto formValueTwo = new IdmFormValueDto(formAttributeTwo);
    formValueTwo.setValue(getHelper().createName());
    List<IdmFormValueDto> formValues = Lists.newArrayList(formValueOne, formValueTwo);
    identity.setEavs(Lists.newArrayList(new IdmFormInstanceDto(identity, formDefinition, formValues)));
    manager.publish(new IdentityProjectionEvent(IdentityProjectionEventType.UPDATE, new IdmIdentityProjectionDto(identity)));
    // 
    IdmIdentityProjectionDto identityProjection = manager.get(identity.getId());
    // 
    Assert.assertEquals(1, identityProjection.getIdentity().getEavs().size());
    Assert.assertEquals(1, identityProjection.getIdentity().getEavs().get(0).getValues().size());
    Assert.assertEquals(formValueOne.getValue(), identityProjection.getIdentity().getEavs().get(0).getValues().get(0).getValue());
}
Also used : IdmFormProjectionDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormProjectionDto) IdmFormInstanceDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormInstanceDto) IdmFormAttributeDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormAttributeDto) IdmFormDefinitionDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto) IdmFormValueDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormValueDto) IdentityProjectionEvent(eu.bcvsolutions.idm.core.eav.api.event.IdentityProjectionEvent) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) FormDefinitionAttributes(eu.bcvsolutions.idm.core.eav.api.dto.FormDefinitionAttributes) IdmIdentityProjectionDto(eu.bcvsolutions.idm.core.api.dto.projection.IdmIdentityProjectionDto) AbstractRestTest(eu.bcvsolutions.idm.test.api.AbstractRestTest) Test(org.junit.Test) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

FormDefinitionAttributes (eu.bcvsolutions.idm.core.eav.api.dto.FormDefinitionAttributes)6 IdmFormAttributeDto (eu.bcvsolutions.idm.core.eav.api.dto.IdmFormAttributeDto)4 IdmFormDefinitionDto (eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto)4 IdmFormInstanceDto (eu.bcvsolutions.idm.core.eav.api.dto.IdmFormInstanceDto)4 IdmFormValueDto (eu.bcvsolutions.idm.core.eav.api.dto.IdmFormValueDto)4 IdmIdentityDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto)3 IdmFormProjectionDto (eu.bcvsolutions.idm.core.eav.api.dto.IdmFormProjectionDto)3 ArrayList (java.util.ArrayList)3 List (java.util.List)3 UUID (java.util.UUID)3 Test (org.junit.Test)3 IdmIdentityProjectionDto (eu.bcvsolutions.idm.core.api.dto.projection.IdmIdentityProjectionDto)2 IdentityProjectionEvent (eu.bcvsolutions.idm.core.eav.api.event.IdentityProjectionEvent)2 AbstractRestTest (eu.bcvsolutions.idm.test.api.AbstractRestTest)2 Transactional (org.springframework.transaction.annotation.Transactional)2 ImmutableMap (com.google.common.collect.ImmutableMap)1 Lists (com.google.common.collect.Lists)1 ValueWrapper (eu.bcvsolutions.idm.core.api.config.cache.domain.ValueWrapper)1 ConfigurationClass (eu.bcvsolutions.idm.core.api.domain.ConfigurationClass)1 ConfigurationClassProperty (eu.bcvsolutions.idm.core.api.domain.ConfigurationClassProperty)1