Search in sources :

Example 61 with Assert.assertTrue

use of org.junit.Assert.assertTrue in project CzechIdMng by bcvsolutions.

the class DefaultEntityEventManagerIntergationTest method testPersistChildEventAutomatically.

/**
 * Child event has to be persisted automatically, when parent event is persisted
 */
@Test
@Transactional
public void testPersistChildEventAutomatically() {
    MockOwner mockOwner = new MockOwner();
    // 
    // root
    IdmEntityEventDto eventDto = manager.prepareEvent(mockOwner, null);
    eventDto.setResult(new OperationResultDto.Builder(OperationState.EXECUTED).build());
    eventDto.setEventType(CoreEventType.CREATE.name());
    eventDto.setPriority(PriorityType.HIGH);
    final IdmEntityEventDto rootEventDto = manager.saveEvent(eventDto);
    // 
    // child
    CoreEvent<MockOwner> childEvent = new CoreEvent<MockOwner>(CoreEventType.CREATE, mockOwner);
    // 
    // process - sync
    manager.process(childEvent, manager.toEvent(rootEventDto));
    // 
    // two event should be persisted
    IdmEntityEventFilter filter = new IdmEntityEventFilter();
    filter.setOwnerType(manager.getOwnerType(mockOwner));
    filter.setOwnerId(mockOwner.getId());
    List<IdmEntityEventDto> content = entityEventService.find(filter, null).getContent();
    Assert.assertEquals(2, content.size());
    Assert.assertTrue(content.stream().allMatch(e -> e.getResult().getState() == OperationState.EXECUTED));
    Assert.assertTrue(content.stream().anyMatch(e -> e.getRootId() == null));
    Assert.assertTrue(content.stream().anyMatch(e -> rootEventDto.getId().equals(e.getRootId()) && e.getEventType().equals(CoreEventType.CREATE.name())));
    // check child event
    IdmEntityEventDto childEventDto = content.stream().filter(e -> rootEventDto.getId().equals(e.getRootId()) && e.getEventType().equals(CoreEventType.CREATE.name())).findFirst().get();
    Assert.assertEquals(rootEventDto.getId(), childEventDto.getParent());
    Assert.assertEquals(rootEventDto.getPriority(), childEventDto.getPriority());
    Assert.assertEquals(rootEventDto.getEventType(), childEventDto.getParentEventType());
}
Also used : DefaultEventContext(eu.bcvsolutions.idm.core.api.event.DefaultEventContext) IdmEntityEventDto(eu.bcvsolutions.idm.core.api.dto.IdmEntityEventDto) AcceptedContent(eu.bcvsolutions.idm.core.event.AcceptedContent) IdmIdentityRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto) EntityGenerateValuesProcessor(eu.bcvsolutions.idm.core.model.event.processor.EntityGenerateValuesProcessor) Autowired(org.springframework.beans.factory.annotation.Autowired) SecurityService(eu.bcvsolutions.idm.core.security.api.service.SecurityService) CoreEvent(eu.bcvsolutions.idm.core.api.event.CoreEvent) ResultCodeException(eu.bcvsolutions.idm.core.api.exception.ResultCodeException) MockDto(eu.bcvsolutions.idm.core.event.domain.MockDto) TransactionContextHolder(eu.bcvsolutions.idm.core.api.domain.TransactionContextHolder) IdentityEventType(eu.bcvsolutions.idm.core.model.event.IdentityEvent.IdentityEventType) ObserveDtoProcessor(eu.bcvsolutions.idm.core.model.event.processor.ObserveDtoProcessor) TestEntityEventProcessorConfiguration(eu.bcvsolutions.idm.core.event.TestEntityEventProcessorConfiguration) EntityEventProcessorFilter(eu.bcvsolutions.idm.core.api.dto.filter.EntityEventProcessorFilter) IdmRoleRequestDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleRequestDto) IdentityContractEventType(eu.bcvsolutions.idm.core.model.event.IdentityContractEvent.IdentityContractEventType) PageRequest(org.springframework.data.domain.PageRequest) IdmEntityStateFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmEntityStateFilter) UUID(java.util.UUID) PriorityType(eu.bcvsolutions.idm.core.api.domain.PriorityType) Serializable(java.io.Serializable) IdmEntityStateDto(eu.bcvsolutions.idm.core.api.dto.IdmEntityStateDto) List(java.util.List) EventConfiguration(eu.bcvsolutions.idm.core.api.config.domain.EventConfiguration) NeverEndingProcessor(eu.bcvsolutions.idm.core.model.event.processor.NeverEndingProcessor) EventType(eu.bcvsolutions.idm.core.api.event.EventType) IdentityContractEvent(eu.bcvsolutions.idm.core.model.event.IdentityContractEvent) IdentityEvent(eu.bcvsolutions.idm.core.model.event.IdentityEvent) EntityEventProcessorDto(eu.bcvsolutions.idm.core.api.dto.EntityEventProcessorDto) IdmIdentityService(eu.bcvsolutions.idm.core.api.service.IdmIdentityService) RoleRequestEventType(eu.bcvsolutions.idm.core.model.event.RoleRequestEvent.RoleRequestEventType) GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString) TestContentTwo(eu.bcvsolutions.idm.core.event.TestContentTwo) EntityEventProcessor(eu.bcvsolutions.idm.core.api.event.EntityEventProcessor) MockOwner(eu.bcvsolutions.idm.core.event.domain.MockOwner) ArrayList(java.util.ArrayList) AbstractDto(eu.bcvsolutions.idm.core.api.dto.AbstractDto) EntityStateManager(eu.bcvsolutions.idm.core.api.service.EntityStateManager) Lists(com.google.common.collect.Lists) OperationResultDto(eu.bcvsolutions.idm.core.api.dto.OperationResultDto) OperationResult(eu.bcvsolutions.idm.core.api.entity.OperationResult) Qualifier(org.springframework.beans.factory.annotation.Qualifier) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) DefaultEventResult(eu.bcvsolutions.idm.core.api.event.DefaultEventResult) EventResult(eu.bcvsolutions.idm.core.api.event.EventResult) IdentityRoleEventType(eu.bcvsolutions.idm.core.model.event.IdentityRoleEvent.IdentityRoleEventType) IdmIdentityContractDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto) EntityEvent(eu.bcvsolutions.idm.core.api.event.EntityEvent) Before(org.junit.Before) IdmIdentityRoleService(eu.bcvsolutions.idm.core.api.service.IdmIdentityRoleService) ConditionalContent(eu.bcvsolutions.idm.core.event.ConditionalContent) CoreException(eu.bcvsolutions.idm.core.api.exception.CoreException) TestIdentityNotifyProcessor(eu.bcvsolutions.idm.core.model.event.processor.TestIdentityNotifyProcessor) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) IdmEntityEventFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmEntityEventFilter) Assert.assertTrue(org.junit.Assert.assertTrue) OperationState(eu.bcvsolutions.idm.core.api.domain.OperationState) Test(org.junit.Test) ApplicationContext(org.springframework.context.ApplicationContext) EventContext(eu.bcvsolutions.idm.core.api.event.EventContext) EmptyEntityEventProcessor(eu.bcvsolutions.idm.core.api.event.EmptyEntityEventProcessor) IdmEntityEventService(eu.bcvsolutions.idm.core.api.service.IdmEntityEventService) IdmRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleDto) CoreResultCode(eu.bcvsolutions.idm.core.api.domain.CoreResultCode) CoreEventType(eu.bcvsolutions.idm.core.api.event.CoreEvent.CoreEventType) TestContent(eu.bcvsolutions.idm.core.event.TestContent) BaseDto(eu.bcvsolutions.idm.core.api.dto.BaseDto) Assert(org.junit.Assert) Assert.assertEquals(org.junit.Assert.assertEquals) Transactional(org.springframework.transaction.annotation.Transactional) MockOwner(eu.bcvsolutions.idm.core.event.domain.MockOwner) CoreEvent(eu.bcvsolutions.idm.core.api.event.CoreEvent) IdmEntityEventFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmEntityEventFilter) IdmEntityEventDto(eu.bcvsolutions.idm.core.api.dto.IdmEntityEventDto) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Test(org.junit.Test) Transactional(org.springframework.transaction.annotation.Transactional)

Example 62 with Assert.assertTrue

use of org.junit.Assert.assertTrue in project CzechIdMng by bcvsolutions.

the class DefaultEntityEventManagerIntergationTest method testAcceptedException.

@Test
public void testAcceptedException() {
    try {
        getHelper().enableAsynchronousProcessing();
        // 
        IdmEntityEventDto event = new IdmEntityEventDto();
        AcceptedContent content = new AcceptedContent();
        content.setId(UUID.randomUUID());
        event.setContent(content);
        event.setOwnerId(content.getId());
        event.setOwnerType(manager.getOwnerType(content));
        event = manager.saveEvent(event);
        manager.executeEvent(event);
        IdmEntityEventFilter filter = new IdmEntityEventFilter();
        filter.setOwnerId(content.getId());
        filter.setStates(Lists.newArrayList(OperationState.EXECUTED));
        // 
        // wait for execute event
        getHelper().waitForResult(res -> {
            return entityEventService.find(filter, PageRequest.of(0, 1)).getContent().isEmpty();
        }, 500, 20);
        // 
        event = manager.getEvent(event.getId());
        Assert.assertEquals(OperationState.EXECUTED, event.getResult().getState());
        Assert.assertEquals(CoreResultCode.ACCEPTED.name(), event.getResult().getCode());
        // 
        // check state is executed too
        IdmEntityStateFilter stateFilter = new IdmEntityStateFilter();
        stateFilter.setEventId(event.getId());
        List<IdmEntityStateDto> states = entityStateManager.findStates(content, null).getContent();
        Assert.assertFalse(states.isEmpty());
        Assert.assertTrue(states.stream().allMatch(s -> s.getResult().getState() == OperationState.EXECUTED && s.getResult().getCode().equals(CoreResultCode.ACCEPTED.name())));
    } finally {
        getHelper().disableAsynchronousProcessing();
    }
}
Also used : IdmEntityStateDto(eu.bcvsolutions.idm.core.api.dto.IdmEntityStateDto) DefaultEventContext(eu.bcvsolutions.idm.core.api.event.DefaultEventContext) IdmEntityEventDto(eu.bcvsolutions.idm.core.api.dto.IdmEntityEventDto) AcceptedContent(eu.bcvsolutions.idm.core.event.AcceptedContent) IdmIdentityRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto) EntityGenerateValuesProcessor(eu.bcvsolutions.idm.core.model.event.processor.EntityGenerateValuesProcessor) Autowired(org.springframework.beans.factory.annotation.Autowired) SecurityService(eu.bcvsolutions.idm.core.security.api.service.SecurityService) CoreEvent(eu.bcvsolutions.idm.core.api.event.CoreEvent) ResultCodeException(eu.bcvsolutions.idm.core.api.exception.ResultCodeException) MockDto(eu.bcvsolutions.idm.core.event.domain.MockDto) TransactionContextHolder(eu.bcvsolutions.idm.core.api.domain.TransactionContextHolder) IdentityEventType(eu.bcvsolutions.idm.core.model.event.IdentityEvent.IdentityEventType) ObserveDtoProcessor(eu.bcvsolutions.idm.core.model.event.processor.ObserveDtoProcessor) TestEntityEventProcessorConfiguration(eu.bcvsolutions.idm.core.event.TestEntityEventProcessorConfiguration) EntityEventProcessorFilter(eu.bcvsolutions.idm.core.api.dto.filter.EntityEventProcessorFilter) IdmRoleRequestDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleRequestDto) IdentityContractEventType(eu.bcvsolutions.idm.core.model.event.IdentityContractEvent.IdentityContractEventType) PageRequest(org.springframework.data.domain.PageRequest) IdmEntityStateFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmEntityStateFilter) UUID(java.util.UUID) PriorityType(eu.bcvsolutions.idm.core.api.domain.PriorityType) Serializable(java.io.Serializable) IdmEntityStateDto(eu.bcvsolutions.idm.core.api.dto.IdmEntityStateDto) List(java.util.List) EventConfiguration(eu.bcvsolutions.idm.core.api.config.domain.EventConfiguration) NeverEndingProcessor(eu.bcvsolutions.idm.core.model.event.processor.NeverEndingProcessor) EventType(eu.bcvsolutions.idm.core.api.event.EventType) IdentityContractEvent(eu.bcvsolutions.idm.core.model.event.IdentityContractEvent) IdentityEvent(eu.bcvsolutions.idm.core.model.event.IdentityEvent) EntityEventProcessorDto(eu.bcvsolutions.idm.core.api.dto.EntityEventProcessorDto) IdmIdentityService(eu.bcvsolutions.idm.core.api.service.IdmIdentityService) RoleRequestEventType(eu.bcvsolutions.idm.core.model.event.RoleRequestEvent.RoleRequestEventType) GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString) TestContentTwo(eu.bcvsolutions.idm.core.event.TestContentTwo) EntityEventProcessor(eu.bcvsolutions.idm.core.api.event.EntityEventProcessor) MockOwner(eu.bcvsolutions.idm.core.event.domain.MockOwner) ArrayList(java.util.ArrayList) AbstractDto(eu.bcvsolutions.idm.core.api.dto.AbstractDto) EntityStateManager(eu.bcvsolutions.idm.core.api.service.EntityStateManager) Lists(com.google.common.collect.Lists) OperationResultDto(eu.bcvsolutions.idm.core.api.dto.OperationResultDto) OperationResult(eu.bcvsolutions.idm.core.api.entity.OperationResult) Qualifier(org.springframework.beans.factory.annotation.Qualifier) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) DefaultEventResult(eu.bcvsolutions.idm.core.api.event.DefaultEventResult) EventResult(eu.bcvsolutions.idm.core.api.event.EventResult) IdentityRoleEventType(eu.bcvsolutions.idm.core.model.event.IdentityRoleEvent.IdentityRoleEventType) IdmIdentityContractDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto) EntityEvent(eu.bcvsolutions.idm.core.api.event.EntityEvent) Before(org.junit.Before) IdmIdentityRoleService(eu.bcvsolutions.idm.core.api.service.IdmIdentityRoleService) ConditionalContent(eu.bcvsolutions.idm.core.event.ConditionalContent) CoreException(eu.bcvsolutions.idm.core.api.exception.CoreException) TestIdentityNotifyProcessor(eu.bcvsolutions.idm.core.model.event.processor.TestIdentityNotifyProcessor) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) IdmEntityEventFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmEntityEventFilter) Assert.assertTrue(org.junit.Assert.assertTrue) OperationState(eu.bcvsolutions.idm.core.api.domain.OperationState) Test(org.junit.Test) ApplicationContext(org.springframework.context.ApplicationContext) EventContext(eu.bcvsolutions.idm.core.api.event.EventContext) EmptyEntityEventProcessor(eu.bcvsolutions.idm.core.api.event.EmptyEntityEventProcessor) IdmEntityEventService(eu.bcvsolutions.idm.core.api.service.IdmEntityEventService) IdmRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleDto) CoreResultCode(eu.bcvsolutions.idm.core.api.domain.CoreResultCode) CoreEventType(eu.bcvsolutions.idm.core.api.event.CoreEvent.CoreEventType) TestContent(eu.bcvsolutions.idm.core.event.TestContent) BaseDto(eu.bcvsolutions.idm.core.api.dto.BaseDto) Assert(org.junit.Assert) Assert.assertEquals(org.junit.Assert.assertEquals) Transactional(org.springframework.transaction.annotation.Transactional) AcceptedContent(eu.bcvsolutions.idm.core.event.AcceptedContent) IdmEntityEventFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmEntityEventFilter) IdmEntityStateFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmEntityStateFilter) IdmEntityEventDto(eu.bcvsolutions.idm.core.api.dto.IdmEntityEventDto) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Test(org.junit.Test)

Example 63 with Assert.assertTrue

use of org.junit.Assert.assertTrue in project CzechIdMng by bcvsolutions.

the class DefaultFormServiceIntegrationTest method testMinMaxStringValidation.

@Test
public void testMinMaxStringValidation() {
    // prepare form definition a test saving form values
    IdmFormAttributeDto attributeShortText = new IdmFormAttributeDto();
    String attributeShortTextCode = getHelper().createName();
    attributeShortText.setCode(attributeShortTextCode);
    attributeShortText.setName(attributeShortTextCode);
    attributeShortText.setPersistentType(PersistentType.SHORTTEXT);
    attributeShortText.setMin(new BigDecimal("3"));
    attributeShortText.setMax(new BigDecimal("5"));
    IdmFormAttributeDto attributeText = new IdmFormAttributeDto();
    String attributeTextCode = getHelper().createName();
    attributeText.setCode(attributeTextCode);
    attributeText.setName(attributeTextCode);
    attributeText.setPersistentType(PersistentType.TEXT);
    attributeText.setMin(new BigDecimal("6"));
    attributeText.setMax(new BigDecimal("8"));
    IdmFormDefinitionDto formDefinitionOne = formService.createDefinition(IdmIdentity.class.getCanonicalName(), getHelper().createName(), Lists.newArrayList(attributeShortText, attributeText));
    attributeShortText = formDefinitionOne.getMappedAttributeByCode(attributeShortText.getCode());
    attributeText = formDefinitionOne.getMappedAttributeByCode(attributeText.getCode());
    // 
    IdmFormValueDto valueShortText = new IdmFormValueDto(attributeShortText);
    IdmFormValueDto valueText = new IdmFormValueDto(attributeText);
    // 
    IdmFormInstanceDto formInstance = new IdmFormInstanceDto();
    formInstance.setFormDefinition(formDefinitionOne);
    formInstance.setValues(Lists.newArrayList(valueShortText, valueText));
    // 
    List<InvalidFormAttributeDto> validationErrors = formService.validate(formInstance);
    // 
    Assert.assertTrue(validationErrors.isEmpty());
    // 
    valueShortText.setShortTextValue("xx");
    valueText.setStringValue("xxxxx");
    // 
    validationErrors = formService.validate(formInstance);
    Assert.assertEquals(2, validationErrors.size());
    Assert.assertTrue(validationErrors.stream().allMatch(e -> e.getMinValue() != null));
    Assert.assertTrue(validationErrors.stream().anyMatch(e -> e.getMinValue().equals(new BigDecimal("3")) && e.getAttributeCode().equals(attributeShortTextCode)));
    Assert.assertTrue(validationErrors.stream().anyMatch(e -> e.getMinValue().equals(new BigDecimal("6")) && e.getAttributeCode().equals(attributeTextCode)));
    // 
    valueShortText.setShortTextValue("xxxxxx");
    valueText.setStringValue("xxxxxxxxx");
    // 
    validationErrors = formService.validate(formInstance);
    Assert.assertEquals(2, validationErrors.size());
    Assert.assertTrue(validationErrors.stream().allMatch(e -> e.getMaxValue() != null));
    Assert.assertTrue(validationErrors.stream().anyMatch(e -> e.getMaxValue().equals(new BigDecimal("5")) && e.getAttributeCode().equals(attributeShortTextCode)));
    Assert.assertTrue(validationErrors.stream().anyMatch(e -> e.getMaxValue().equals(new BigDecimal("8")) && e.getAttributeCode().equals(attributeTextCode)));
    // 
    valueShortText.setShortTextValue("xxxxx");
    valueText.setStringValue("xxxxxxxx");
    // 
    validationErrors = formService.validate(formInstance);
    Assert.assertTrue(validationErrors.isEmpty());
    // 
    valueShortText.setShortTextValue("xxx");
    valueText.setStringValue("xxxxxx");
    // 
    validationErrors = formService.validate(formInstance);
    Assert.assertTrue(validationErrors.isEmpty());
}
Also used : IdmFormInstanceDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormInstanceDto) IdmEntityEventDto(eu.bcvsolutions.idm.core.api.dto.IdmEntityEventDto) ZonedDateTime(java.time.ZonedDateTime) IdmFormAttributeDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormAttributeDto) IdmIdentityContract(eu.bcvsolutions.idm.core.model.entity.IdmIdentityContract) IdmTreeNodeDto(eu.bcvsolutions.idm.core.api.dto.IdmTreeNodeDto) Autowired(org.springframework.beans.factory.annotation.Autowired) FormDefinitionCache(eu.bcvsolutions.idm.core.eav.api.domain.FormDefinitionCache) IdmRoleFormValue_(eu.bcvsolutions.idm.core.model.entity.eav.IdmRoleFormValue_) FormService(eu.bcvsolutions.idm.core.eav.api.service.FormService) BigDecimal(java.math.BigDecimal) CoreEvent(eu.bcvsolutions.idm.core.api.event.CoreEvent) CoreGroupPermission(eu.bcvsolutions.idm.core.model.domain.CoreGroupPermission) IdmFormValueDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormValueDto) Predicate(javax.persistence.criteria.Predicate) IdmFormDefinition(eu.bcvsolutions.idm.core.eav.entity.IdmFormDefinition) ResultCodeException(eu.bcvsolutions.idm.core.api.exception.ResultCodeException) Map(java.util.Map) ChangePersistentTypeException(eu.bcvsolutions.idm.core.eav.api.exception.ChangePersistentTypeException) IdmIdentityFormValue(eu.bcvsolutions.idm.core.model.entity.eav.IdmIdentityFormValue) CriteriaBuilder(javax.persistence.criteria.CriteriaBuilder) IdmFormAttributeService(eu.bcvsolutions.idm.core.eav.api.service.IdmFormAttributeService) IdentityEventType(eu.bcvsolutions.idm.core.model.event.IdentityEvent.IdentityEventType) Sort(org.springframework.data.domain.Sort) CriteriaQuery(javax.persistence.criteria.CriteriaQuery) IdmIdentity(eu.bcvsolutions.idm.core.model.entity.IdmIdentity) AbstractEntity(eu.bcvsolutions.idm.core.api.entity.AbstractEntity) PageRequest(org.springframework.data.domain.PageRequest) UUID(java.util.UUID) IdmRoleRepository(eu.bcvsolutions.idm.core.model.repository.IdmRoleRepository) Page(org.springframework.data.domain.Page) PriorityType(eu.bcvsolutions.idm.core.api.domain.PriorityType) Serializable(java.io.Serializable) ChangeConfidentialException(eu.bcvsolutions.idm.core.eav.api.exception.ChangeConfidentialException) List(java.util.List) EventConfiguration(eu.bcvsolutions.idm.core.api.config.domain.EventConfiguration) IdmFormAttribute(eu.bcvsolutions.idm.core.eav.entity.IdmFormAttribute) Specification(org.springframework.data.jpa.domain.Specification) Identifiable(eu.bcvsolutions.idm.core.api.domain.Identifiable) IdmIdentityService(eu.bcvsolutions.idm.core.api.service.IdmIdentityService) GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString) FormableDto(eu.bcvsolutions.idm.core.api.dto.FormableDto) IdmFormAttribute_(eu.bcvsolutions.idm.core.eav.entity.IdmFormAttribute_) IdmRole(eu.bcvsolutions.idm.core.model.entity.IdmRole) IdmAttachmentDto(eu.bcvsolutions.idm.core.ecm.api.dto.IdmAttachmentDto) ArrayList(java.util.ArrayList) PersistentType(eu.bcvsolutions.idm.core.eav.api.domain.PersistentType) IdmFormValueFilter(eu.bcvsolutions.idm.core.eav.api.dto.filter.IdmFormValueFilter) AbstractDto(eu.bcvsolutions.idm.core.api.dto.AbstractDto) IdmBasePermission(eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission) Lists(com.google.common.collect.Lists) LookupService(eu.bcvsolutions.idm.core.api.service.LookupService) AbstractFormValueEvaluator(eu.bcvsolutions.idm.core.security.evaluator.eav.AbstractFormValueEvaluator) CoreModuleDescriptor(eu.bcvsolutions.idm.core.CoreModuleDescriptor) DefaultFormableFilter(eu.bcvsolutions.idm.core.api.dto.filter.DefaultFormableFilter) DefaultAttachmentManagerIntegrationTest(eu.bcvsolutions.idm.core.ecm.service.impl.DefaultAttachmentManagerIntegrationTest) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Direction(org.springframework.data.domain.Sort.Direction) IdmFormInstanceDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormInstanceDto) IdmIdentityContractDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto) Root(javax.persistence.criteria.Root) Before(org.junit.Before) IdentityFormValueEvaluator(eu.bcvsolutions.idm.core.security.evaluator.eav.IdentityFormValueEvaluator) Assert.assertNotNull(org.junit.Assert.assertNotNull) AttachmentManager(eu.bcvsolutions.idm.core.ecm.api.service.AttachmentManager) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) IdmEntityEventFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmEntityEventFilter) IdmCacheManager(eu.bcvsolutions.idm.core.api.service.IdmCacheManager) IdmRoleFormValue(eu.bcvsolutions.idm.core.model.entity.eav.IdmRoleFormValue) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) ApplicationContext(org.springframework.context.ApplicationContext) ConfigurationMap(eu.bcvsolutions.idm.core.api.domain.ConfigurationMap) InitDemoDataProcessor(eu.bcvsolutions.idm.core.model.event.processor.module.InitDemoDataProcessor) IdmFormDefinitionDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto) IdmTreeNode(eu.bcvsolutions.idm.core.model.entity.IdmTreeNode) IdmEntityEventService(eu.bcvsolutions.idm.core.api.service.IdmEntityEventService) Assert.assertNull(org.junit.Assert.assertNull) ChronoUnit(java.time.temporal.ChronoUnit) IdmRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleDto) FormValueService(eu.bcvsolutions.idm.core.eav.api.service.FormValueService) IdmFormDefinitionService(eu.bcvsolutions.idm.core.eav.api.service.IdmFormDefinitionService) IdmEntityEvent_(eu.bcvsolutions.idm.core.model.entity.IdmEntityEvent_) CoreEventType(eu.bcvsolutions.idm.core.api.event.CoreEvent.CoreEventType) AbstractFormableService(eu.bcvsolutions.idm.core.eav.api.service.AbstractFormableService) Subquery(javax.persistence.criteria.Subquery) Assert(org.junit.Assert) FormAttributeValidateProcessor(eu.bcvsolutions.idm.core.eav.processor.FormAttributeValidateProcessor) Assert.assertEquals(org.junit.Assert.assertEquals) EntityEventManager(eu.bcvsolutions.idm.core.api.service.EntityEventManager) Transactional(org.springframework.transaction.annotation.Transactional) FormDefinitionAttributes(eu.bcvsolutions.idm.core.eav.api.dto.FormDefinitionAttributes) InvalidFormAttributeDto(eu.bcvsolutions.idm.core.eav.api.dto.InvalidFormAttributeDto) IdmFormAttributeDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormAttributeDto) InvalidFormAttributeDto(eu.bcvsolutions.idm.core.eav.api.dto.InvalidFormAttributeDto) IdmFormDefinitionDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto) IdmFormValueDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormValueDto) GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString) IdmIdentity(eu.bcvsolutions.idm.core.model.entity.IdmIdentity) BigDecimal(java.math.BigDecimal) DefaultAttachmentManagerIntegrationTest(eu.bcvsolutions.idm.core.ecm.service.impl.DefaultAttachmentManagerIntegrationTest) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Test(org.junit.Test)

Example 64 with Assert.assertTrue

use of org.junit.Assert.assertTrue in project CzechIdMng by bcvsolutions.

the class DefaultFormServiceIntegrationTest method testGetAttributes.

@Test
public void testGetAttributes() {
    IdmFormAttributeDto attributeOne = new IdmFormAttributeDto(getHelper().createName(), getHelper().createName(), PersistentType.SHORTTEXT);
    IdmFormAttributeDto attributeTwo = new IdmFormAttributeDto(getHelper().createName(), getHelper().createName(), PersistentType.SHORTTEXT);
    IdmFormDefinitionDto definitionOne = formService.createDefinition(IdmIdentity.class, getHelper().createName(), Lists.newArrayList(attributeOne, attributeTwo));
    IdmFormAttributeDto attributeOther = new IdmFormAttributeDto(getHelper().createName(), getHelper().createName(), PersistentType.SHORTTEXT);
    IdmFormDefinitionDto definitionOther = formService.createDefinition(IdmIdentityDto.class, getHelper().createName(), Lists.newArrayList(attributeOther));
    Assert.assertEquals(CoreModuleDescriptor.MODULE_ID, definitionOther.getModule());
    // 
    List<IdmFormAttributeDto> results = formService.getAttributes(definitionOne);
    // 
    Assert.assertTrue(results.stream().anyMatch(a -> a.getCode().equals(attributeOne.getCode())));
    Assert.assertTrue(results.stream().anyMatch(a -> a.getCode().equals(attributeTwo.getCode())));
    Assert.assertFalse(results.stream().anyMatch(a -> a.getCode().equals(attributeOther.getCode())));
    // 
    results = formService.getAttributes(definitionOther);
    // 
    Assert.assertFalse(results.stream().anyMatch(a -> a.getCode().equals(attributeOne.getCode())));
    Assert.assertFalse(results.stream().anyMatch(a -> a.getCode().equals(attributeTwo.getCode())));
    Assert.assertTrue(results.stream().anyMatch(a -> a.getCode().equals(attributeOther.getCode())));
}
Also used : IdmEntityEventDto(eu.bcvsolutions.idm.core.api.dto.IdmEntityEventDto) ZonedDateTime(java.time.ZonedDateTime) IdmFormAttributeDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormAttributeDto) IdmIdentityContract(eu.bcvsolutions.idm.core.model.entity.IdmIdentityContract) IdmTreeNodeDto(eu.bcvsolutions.idm.core.api.dto.IdmTreeNodeDto) Autowired(org.springframework.beans.factory.annotation.Autowired) FormDefinitionCache(eu.bcvsolutions.idm.core.eav.api.domain.FormDefinitionCache) IdmRoleFormValue_(eu.bcvsolutions.idm.core.model.entity.eav.IdmRoleFormValue_) FormService(eu.bcvsolutions.idm.core.eav.api.service.FormService) BigDecimal(java.math.BigDecimal) CoreEvent(eu.bcvsolutions.idm.core.api.event.CoreEvent) CoreGroupPermission(eu.bcvsolutions.idm.core.model.domain.CoreGroupPermission) IdmFormValueDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormValueDto) Predicate(javax.persistence.criteria.Predicate) IdmFormDefinition(eu.bcvsolutions.idm.core.eav.entity.IdmFormDefinition) ResultCodeException(eu.bcvsolutions.idm.core.api.exception.ResultCodeException) Map(java.util.Map) ChangePersistentTypeException(eu.bcvsolutions.idm.core.eav.api.exception.ChangePersistentTypeException) IdmIdentityFormValue(eu.bcvsolutions.idm.core.model.entity.eav.IdmIdentityFormValue) CriteriaBuilder(javax.persistence.criteria.CriteriaBuilder) IdmFormAttributeService(eu.bcvsolutions.idm.core.eav.api.service.IdmFormAttributeService) IdentityEventType(eu.bcvsolutions.idm.core.model.event.IdentityEvent.IdentityEventType) Sort(org.springframework.data.domain.Sort) CriteriaQuery(javax.persistence.criteria.CriteriaQuery) IdmIdentity(eu.bcvsolutions.idm.core.model.entity.IdmIdentity) AbstractEntity(eu.bcvsolutions.idm.core.api.entity.AbstractEntity) PageRequest(org.springframework.data.domain.PageRequest) UUID(java.util.UUID) IdmRoleRepository(eu.bcvsolutions.idm.core.model.repository.IdmRoleRepository) Page(org.springframework.data.domain.Page) PriorityType(eu.bcvsolutions.idm.core.api.domain.PriorityType) Serializable(java.io.Serializable) ChangeConfidentialException(eu.bcvsolutions.idm.core.eav.api.exception.ChangeConfidentialException) List(java.util.List) EventConfiguration(eu.bcvsolutions.idm.core.api.config.domain.EventConfiguration) IdmFormAttribute(eu.bcvsolutions.idm.core.eav.entity.IdmFormAttribute) Specification(org.springframework.data.jpa.domain.Specification) Identifiable(eu.bcvsolutions.idm.core.api.domain.Identifiable) IdmIdentityService(eu.bcvsolutions.idm.core.api.service.IdmIdentityService) GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString) FormableDto(eu.bcvsolutions.idm.core.api.dto.FormableDto) IdmFormAttribute_(eu.bcvsolutions.idm.core.eav.entity.IdmFormAttribute_) IdmRole(eu.bcvsolutions.idm.core.model.entity.IdmRole) IdmAttachmentDto(eu.bcvsolutions.idm.core.ecm.api.dto.IdmAttachmentDto) ArrayList(java.util.ArrayList) PersistentType(eu.bcvsolutions.idm.core.eav.api.domain.PersistentType) IdmFormValueFilter(eu.bcvsolutions.idm.core.eav.api.dto.filter.IdmFormValueFilter) AbstractDto(eu.bcvsolutions.idm.core.api.dto.AbstractDto) IdmBasePermission(eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission) Lists(com.google.common.collect.Lists) LookupService(eu.bcvsolutions.idm.core.api.service.LookupService) AbstractFormValueEvaluator(eu.bcvsolutions.idm.core.security.evaluator.eav.AbstractFormValueEvaluator) CoreModuleDescriptor(eu.bcvsolutions.idm.core.CoreModuleDescriptor) DefaultFormableFilter(eu.bcvsolutions.idm.core.api.dto.filter.DefaultFormableFilter) DefaultAttachmentManagerIntegrationTest(eu.bcvsolutions.idm.core.ecm.service.impl.DefaultAttachmentManagerIntegrationTest) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Direction(org.springframework.data.domain.Sort.Direction) IdmFormInstanceDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormInstanceDto) IdmIdentityContractDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto) Root(javax.persistence.criteria.Root) Before(org.junit.Before) IdentityFormValueEvaluator(eu.bcvsolutions.idm.core.security.evaluator.eav.IdentityFormValueEvaluator) Assert.assertNotNull(org.junit.Assert.assertNotNull) AttachmentManager(eu.bcvsolutions.idm.core.ecm.api.service.AttachmentManager) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) IdmEntityEventFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmEntityEventFilter) IdmCacheManager(eu.bcvsolutions.idm.core.api.service.IdmCacheManager) IdmRoleFormValue(eu.bcvsolutions.idm.core.model.entity.eav.IdmRoleFormValue) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) ApplicationContext(org.springframework.context.ApplicationContext) ConfigurationMap(eu.bcvsolutions.idm.core.api.domain.ConfigurationMap) InitDemoDataProcessor(eu.bcvsolutions.idm.core.model.event.processor.module.InitDemoDataProcessor) IdmFormDefinitionDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto) IdmTreeNode(eu.bcvsolutions.idm.core.model.entity.IdmTreeNode) IdmEntityEventService(eu.bcvsolutions.idm.core.api.service.IdmEntityEventService) Assert.assertNull(org.junit.Assert.assertNull) ChronoUnit(java.time.temporal.ChronoUnit) IdmRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleDto) FormValueService(eu.bcvsolutions.idm.core.eav.api.service.FormValueService) IdmFormDefinitionService(eu.bcvsolutions.idm.core.eav.api.service.IdmFormDefinitionService) IdmEntityEvent_(eu.bcvsolutions.idm.core.model.entity.IdmEntityEvent_) CoreEventType(eu.bcvsolutions.idm.core.api.event.CoreEvent.CoreEventType) AbstractFormableService(eu.bcvsolutions.idm.core.eav.api.service.AbstractFormableService) Subquery(javax.persistence.criteria.Subquery) Assert(org.junit.Assert) FormAttributeValidateProcessor(eu.bcvsolutions.idm.core.eav.processor.FormAttributeValidateProcessor) Assert.assertEquals(org.junit.Assert.assertEquals) EntityEventManager(eu.bcvsolutions.idm.core.api.service.EntityEventManager) Transactional(org.springframework.transaction.annotation.Transactional) FormDefinitionAttributes(eu.bcvsolutions.idm.core.eav.api.dto.FormDefinitionAttributes) InvalidFormAttributeDto(eu.bcvsolutions.idm.core.eav.api.dto.InvalidFormAttributeDto) IdmFormAttributeDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormAttributeDto) IdmFormDefinitionDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto) DefaultAttachmentManagerIntegrationTest(eu.bcvsolutions.idm.core.ecm.service.impl.DefaultAttachmentManagerIntegrationTest) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Test(org.junit.Test)

Example 65 with Assert.assertTrue

use of org.junit.Assert.assertTrue in project CzechIdMng by bcvsolutions.

the class DefaultFormServiceIntegrationTest method testGetDefinitions.

@Test
public void testGetDefinitions() {
    IdmIdentityDto owner = getHelper().createIdentity((GuardedString) null);
    // 
    IdmFormDefinitionDto definitionOne = formService.createDefinition(IdmIdentity.class, getHelper().createName(), null);
    IdmFormDefinitionDto definitionTwo = formService.createDefinition(owner.getClass(), getHelper().createName(), null);
    IdmFormDefinitionDto definitionOther = formService.createDefinition(IdmRole.class, getHelper().createName(), null);
    // 
    List<IdmFormDefinitionDto> results = formService.getDefinitions(IdmIdentity.class);
    // 
    Assert.assertTrue(results.stream().anyMatch(d -> d.getId().equals(definitionOne.getId())));
    Assert.assertTrue(results.stream().anyMatch(d -> d.getId().equals(definitionTwo.getId())));
    Assert.assertFalse(results.stream().anyMatch(d -> d.getId().equals(definitionOther.getId())));
    // 
    results = formService.getDefinitions(owner.getClass());
    // 
    Assert.assertTrue(results.stream().anyMatch(d -> d.getId().equals(definitionOne.getId())));
    Assert.assertTrue(results.stream().anyMatch(d -> d.getId().equals(definitionTwo.getId())));
    Assert.assertFalse(results.stream().anyMatch(d -> d.getId().equals(definitionOther.getId())));
    // 
    results = formService.getDefinitions(owner);
    // 
    Assert.assertTrue(results.stream().anyMatch(d -> d.getId().equals(definitionOne.getId())));
    Assert.assertTrue(results.stream().anyMatch(d -> d.getId().equals(definitionTwo.getId())));
    Assert.assertFalse(results.stream().anyMatch(d -> d.getId().equals(definitionOther.getId())));
}
Also used : IdmEntityEventDto(eu.bcvsolutions.idm.core.api.dto.IdmEntityEventDto) ZonedDateTime(java.time.ZonedDateTime) IdmFormAttributeDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormAttributeDto) IdmIdentityContract(eu.bcvsolutions.idm.core.model.entity.IdmIdentityContract) IdmTreeNodeDto(eu.bcvsolutions.idm.core.api.dto.IdmTreeNodeDto) Autowired(org.springframework.beans.factory.annotation.Autowired) FormDefinitionCache(eu.bcvsolutions.idm.core.eav.api.domain.FormDefinitionCache) IdmRoleFormValue_(eu.bcvsolutions.idm.core.model.entity.eav.IdmRoleFormValue_) FormService(eu.bcvsolutions.idm.core.eav.api.service.FormService) BigDecimal(java.math.BigDecimal) CoreEvent(eu.bcvsolutions.idm.core.api.event.CoreEvent) CoreGroupPermission(eu.bcvsolutions.idm.core.model.domain.CoreGroupPermission) IdmFormValueDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormValueDto) Predicate(javax.persistence.criteria.Predicate) IdmFormDefinition(eu.bcvsolutions.idm.core.eav.entity.IdmFormDefinition) ResultCodeException(eu.bcvsolutions.idm.core.api.exception.ResultCodeException) Map(java.util.Map) ChangePersistentTypeException(eu.bcvsolutions.idm.core.eav.api.exception.ChangePersistentTypeException) IdmIdentityFormValue(eu.bcvsolutions.idm.core.model.entity.eav.IdmIdentityFormValue) CriteriaBuilder(javax.persistence.criteria.CriteriaBuilder) IdmFormAttributeService(eu.bcvsolutions.idm.core.eav.api.service.IdmFormAttributeService) IdentityEventType(eu.bcvsolutions.idm.core.model.event.IdentityEvent.IdentityEventType) Sort(org.springframework.data.domain.Sort) CriteriaQuery(javax.persistence.criteria.CriteriaQuery) IdmIdentity(eu.bcvsolutions.idm.core.model.entity.IdmIdentity) AbstractEntity(eu.bcvsolutions.idm.core.api.entity.AbstractEntity) PageRequest(org.springframework.data.domain.PageRequest) UUID(java.util.UUID) IdmRoleRepository(eu.bcvsolutions.idm.core.model.repository.IdmRoleRepository) Page(org.springframework.data.domain.Page) PriorityType(eu.bcvsolutions.idm.core.api.domain.PriorityType) Serializable(java.io.Serializable) ChangeConfidentialException(eu.bcvsolutions.idm.core.eav.api.exception.ChangeConfidentialException) List(java.util.List) EventConfiguration(eu.bcvsolutions.idm.core.api.config.domain.EventConfiguration) IdmFormAttribute(eu.bcvsolutions.idm.core.eav.entity.IdmFormAttribute) Specification(org.springframework.data.jpa.domain.Specification) Identifiable(eu.bcvsolutions.idm.core.api.domain.Identifiable) IdmIdentityService(eu.bcvsolutions.idm.core.api.service.IdmIdentityService) GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString) FormableDto(eu.bcvsolutions.idm.core.api.dto.FormableDto) IdmFormAttribute_(eu.bcvsolutions.idm.core.eav.entity.IdmFormAttribute_) IdmRole(eu.bcvsolutions.idm.core.model.entity.IdmRole) IdmAttachmentDto(eu.bcvsolutions.idm.core.ecm.api.dto.IdmAttachmentDto) ArrayList(java.util.ArrayList) PersistentType(eu.bcvsolutions.idm.core.eav.api.domain.PersistentType) IdmFormValueFilter(eu.bcvsolutions.idm.core.eav.api.dto.filter.IdmFormValueFilter) AbstractDto(eu.bcvsolutions.idm.core.api.dto.AbstractDto) IdmBasePermission(eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission) Lists(com.google.common.collect.Lists) LookupService(eu.bcvsolutions.idm.core.api.service.LookupService) AbstractFormValueEvaluator(eu.bcvsolutions.idm.core.security.evaluator.eav.AbstractFormValueEvaluator) CoreModuleDescriptor(eu.bcvsolutions.idm.core.CoreModuleDescriptor) DefaultFormableFilter(eu.bcvsolutions.idm.core.api.dto.filter.DefaultFormableFilter) DefaultAttachmentManagerIntegrationTest(eu.bcvsolutions.idm.core.ecm.service.impl.DefaultAttachmentManagerIntegrationTest) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Direction(org.springframework.data.domain.Sort.Direction) IdmFormInstanceDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormInstanceDto) IdmIdentityContractDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto) Root(javax.persistence.criteria.Root) Before(org.junit.Before) IdentityFormValueEvaluator(eu.bcvsolutions.idm.core.security.evaluator.eav.IdentityFormValueEvaluator) Assert.assertNotNull(org.junit.Assert.assertNotNull) AttachmentManager(eu.bcvsolutions.idm.core.ecm.api.service.AttachmentManager) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) IdmEntityEventFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmEntityEventFilter) IdmCacheManager(eu.bcvsolutions.idm.core.api.service.IdmCacheManager) IdmRoleFormValue(eu.bcvsolutions.idm.core.model.entity.eav.IdmRoleFormValue) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) ApplicationContext(org.springframework.context.ApplicationContext) ConfigurationMap(eu.bcvsolutions.idm.core.api.domain.ConfigurationMap) InitDemoDataProcessor(eu.bcvsolutions.idm.core.model.event.processor.module.InitDemoDataProcessor) IdmFormDefinitionDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto) IdmTreeNode(eu.bcvsolutions.idm.core.model.entity.IdmTreeNode) IdmEntityEventService(eu.bcvsolutions.idm.core.api.service.IdmEntityEventService) Assert.assertNull(org.junit.Assert.assertNull) ChronoUnit(java.time.temporal.ChronoUnit) IdmRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleDto) FormValueService(eu.bcvsolutions.idm.core.eav.api.service.FormValueService) IdmFormDefinitionService(eu.bcvsolutions.idm.core.eav.api.service.IdmFormDefinitionService) IdmEntityEvent_(eu.bcvsolutions.idm.core.model.entity.IdmEntityEvent_) CoreEventType(eu.bcvsolutions.idm.core.api.event.CoreEvent.CoreEventType) AbstractFormableService(eu.bcvsolutions.idm.core.eav.api.service.AbstractFormableService) Subquery(javax.persistence.criteria.Subquery) Assert(org.junit.Assert) FormAttributeValidateProcessor(eu.bcvsolutions.idm.core.eav.processor.FormAttributeValidateProcessor) Assert.assertEquals(org.junit.Assert.assertEquals) EntityEventManager(eu.bcvsolutions.idm.core.api.service.EntityEventManager) Transactional(org.springframework.transaction.annotation.Transactional) FormDefinitionAttributes(eu.bcvsolutions.idm.core.eav.api.dto.FormDefinitionAttributes) InvalidFormAttributeDto(eu.bcvsolutions.idm.core.eav.api.dto.InvalidFormAttributeDto) IdmFormDefinitionDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) DefaultAttachmentManagerIntegrationTest(eu.bcvsolutions.idm.core.ecm.service.impl.DefaultAttachmentManagerIntegrationTest) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Test(org.junit.Test)

Aggregations

Assert (org.junit.Assert)88 Assert.assertTrue (org.junit.Assert.assertTrue)88 Test (org.junit.Test)88 Assert.assertEquals (org.junit.Assert.assertEquals)84 List (java.util.List)82 Before (org.junit.Before)67 UUID (java.util.UUID)55 Assert.assertFalse (org.junit.Assert.assertFalse)54 Autowired (org.springframework.beans.factory.annotation.Autowired)53 Assert.assertNotNull (org.junit.Assert.assertNotNull)52 IdmIdentityDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto)51 IdmRoleDto (eu.bcvsolutions.idm.core.api.dto.IdmRoleDto)51 IdmIdentityContractDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto)49 GuardedString (eu.bcvsolutions.idm.core.security.api.domain.GuardedString)48 Transactional (org.springframework.transaction.annotation.Transactional)46 After (org.junit.After)44 AbstractIntegrationTest (eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)42 ApplicationContext (org.springframework.context.ApplicationContext)38 IdmIdentityRoleDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto)37 ResultCodeException (eu.bcvsolutions.idm.core.api.exception.ResultCodeException)36