Search in sources :

Example 16 with IdmIdentityContractFilter

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

the class HrContractExclusionProcess method getItemsToProcess.

/**
 * {@inheritDoc}
 *
 * Find all identity contracts, that are both valid and disabled.
 */
@Override
public Page<IdmIdentityContractDto> getItemsToProcess(Pageable pageable) {
    IdmIdentityContractFilter filter = new IdmIdentityContractFilter();
    filter.setValid(Boolean.TRUE);
    filter.setState(ContractState.EXCLUDED);
    return identityContractService.find(filter, pageable);
}
Also used : IdmIdentityContractFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmIdentityContractFilter)

Example 17 with IdmIdentityContractFilter

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

the class HrEnableContractProcess method getItemsToProcess.

/**
 * {@inheritDoc}
 *
 * Find all identity contracts, that are both valid and enabled.
 */
@Override
public Page<IdmIdentityContractDto> getItemsToProcess(Pageable pageable) {
    IdmIdentityContractFilter filter = new IdmIdentityContractFilter();
    filter.setValid(Boolean.TRUE);
    filter.setDisabled(Boolean.FALSE);
    return identityContractService.find(filter, pageable);
}
Also used : IdmIdentityContractFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmIdentityContractFilter)

Example 18 with IdmIdentityContractFilter

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

the class DefaultIdmIdentityContractServiceIntegrationTest method mainFilterTest.

@Test
public void mainFilterTest() {
    IdmIdentityDto identity = helper.createIdentity();
    IdmIdentityDto identity2 = helper.createIdentity();
    IdmTreeNodeDto node = helper.createTreeNode();
    IdmTreeNodeDto node2 = helper.createTreeNode();
    IdmIdentityContractDto contract = helper.createIdentityContact(identity, node);
    IdmIdentityContractDto contract2 = helper.createIdentityContact(identity2, node2);
    contract.setMain(true);
    service.save(contract);
    contract2.setMain(false);
    service.save(contract2);
    IdmIdentityContractFilter filter = new IdmIdentityContractFilter();
    filter.setMain(true);
    Page<IdmIdentityContractDto> result = service.find(filter, null);
    assertTrue(result.getContent().contains(contract));
    assertFalse(result.getContent().contains(contract2));
    filter.setMain(false);
    result = service.find(filter, null);
    assertTrue(result.getContent().contains(contract2));
    assertFalse(result.getContent().contains(contract));
}
Also used : IdmIdentityContractFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmIdentityContractFilter) IdmTreeNodeDto(eu.bcvsolutions.idm.core.api.dto.IdmTreeNodeDto) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) IdmIdentityContractDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Test(org.junit.Test)

Example 19 with IdmIdentityContractFilter

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

the class DefaultIdmIdentityContractServiceIntegrationTest method identityFilterTest.

@Test
public void identityFilterTest() {
    IdmIdentityDto identity = helper.createIdentity();
    IdmTreeNodeDto node = helper.createTreeNode();
    IdmTreeNodeDto node2 = helper.createTreeNode();
    IdmIdentityContractDto contract = helper.createIdentityContact(identity, node);
    IdmIdentityContractDto contract2 = helper.createIdentityContact(identity, node2);
    IdmIdentityContractFilter filter = new IdmIdentityContractFilter();
    filter.setIdentity(identity.getId());
    Page<IdmIdentityContractDto> result = service.find(filter, null);
    assertEquals("Wrong Identity", 3, result.getTotalElements());
    assertTrue(result.getContent().contains(service.getPrimeContract(identity.getId())));
    assertTrue(result.getContent().contains(contract));
    assertTrue(result.getContent().contains(contract2));
}
Also used : IdmIdentityContractFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmIdentityContractFilter) IdmTreeNodeDto(eu.bcvsolutions.idm.core.api.dto.IdmTreeNodeDto) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) IdmIdentityContractDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Test(org.junit.Test)

Aggregations

IdmIdentityContractFilter (eu.bcvsolutions.idm.core.api.dto.filter.IdmIdentityContractFilter)19 IdmIdentityContractDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto)15 AbstractIntegrationTest (eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)14 Test (org.junit.Test)14 AbstractSysSyncConfigDto (eu.bcvsolutions.idm.acc.dto.AbstractSysSyncConfigDto)9 SysSyncContractConfigDto (eu.bcvsolutions.idm.acc.dto.SysSyncContractConfigDto)9 SysSyncLogDto (eu.bcvsolutions.idm.acc.dto.SysSyncLogDto)9 SysSystemDto (eu.bcvsolutions.idm.acc.dto.SysSystemDto)9 IdmIdentityDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto)8 IdmTreeNodeDto (eu.bcvsolutions.idm.core.api.dto.IdmTreeNodeDto)7 IdmTreeTypeDto (eu.bcvsolutions.idm.core.api.dto.IdmTreeTypeDto)2 IdentityContractEvent (eu.bcvsolutions.idm.core.model.event.IdentityContractEvent)2 AccAccountDto (eu.bcvsolutions.idm.acc.dto.AccAccountDto)1 AccContractAccountDto (eu.bcvsolutions.idm.acc.dto.AccContractAccountDto)1 AccContractAccountFilter (eu.bcvsolutions.idm.acc.dto.filter.AccContractAccountFilter)1 ProvisioningException (eu.bcvsolutions.idm.acc.exception.ProvisioningException)1 IdmContractGuaranteeDto (eu.bcvsolutions.idm.core.api.dto.IdmContractGuaranteeDto)1 CorrelationFilter (eu.bcvsolutions.idm.core.api.dto.filter.CorrelationFilter)1 IdmContractGuaranteeFilter (eu.bcvsolutions.idm.core.api.dto.filter.IdmContractGuaranteeFilter)1 IdmTreeNodeFilter (eu.bcvsolutions.idm.core.api.dto.filter.IdmTreeNodeFilter)1