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);
}
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);
}
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));
}
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));
}
Aggregations