use of eu.bcvsolutions.idm.core.api.dto.filter.IdmIdentityFilter in project CzechIdMng by bcvsolutions.
the class IdentityFilterTest method testSameButDifferentTreeTypeFilter.
@Test
public void testSameButDifferentTreeTypeFilter() {
IdmIdentityDto person1 = getIdmIdentity("thistn01", "thistn01", "thistn02@a.eu", "000010001", false);
getIdmIdentity("thistn01", "thistn01", "thistn02@a.eu", "000010001", false);
IdmTreeTypeDto type1 = helper.createTreeType("typeName001");
IdmTreeTypeDto type2 = helper.createTreeType("typeName002");
IdmTreeNodeDto node1 = helper.createTreeNode(type1, "nodeName001", null);
helper.createTreeNode(type2, "nodeName002", null);
helper.createIdentityContact(person1, node1);
helper.createIdentityContact(person1, node1);
IdmIdentityFilter filter = new IdmIdentityFilter();
filter.setFirstName(person1.getFirstName());
Page<IdmIdentityDto> result = identityService.find(filter, null);
assertEquals("Wrong sameButDiff filter", 2, result.getTotalElements());
filter.setTreeType(type1.getId());
result = identityService.find(filter, null);
assertEquals("Wrong sameButDiff filter 2", 1, result.getTotalElements());
}
use of eu.bcvsolutions.idm.core.api.dto.filter.IdmIdentityFilter in project CzechIdMng by bcvsolutions.
the class IdentityFilterTest method testTreeTypeFilter.
@Test
public void testTreeTypeFilter() {
IdmIdentityDto person = getIdmIdentity("ThisIsTestName007", "ThisIsTestName007", "ThisIsTestName007@gemail.eu", "000000007", false);
IdmTreeTypeDto type = helper.createTreeType("ThisIsTestType002");
IdmTreeNodeDto node = helper.createTreeNode(type, "ThisIsTestNode002", null);
UUID typeUuid = type.getId();
helper.createIdentityContact(person, node);
IdmIdentityFilter filter = new IdmIdentityFilter();
filter.setTreeType(typeUuid);
Page<IdmIdentityDto> result = identityService.find(filter, null);
assertEquals("Wrong TreeType", 1, result.getTotalElements());
}
use of eu.bcvsolutions.idm.core.api.dto.filter.IdmIdentityFilter in project CzechIdMng by bcvsolutions.
the class IdentityFilterTest method testMoreToFindInFilter.
@Test
public void testMoreToFindInFilter() {
IdmIdentityDto person1 = getIdmIdentity("tn00", "tn00", "tn01@a.eu", "000000001", false);
getIdmIdentity("tn00", "tn00", "tn01@a.eu", "000000001", false);
getIdmIdentity("tn00", "tn00", "tn01@a.eu", "000000001", false);
getIdmIdentity("tn001", "tn00", "tn01@a.eu", "000000001", false);
IdmIdentityFilter filter = new IdmIdentityFilter();
filter.setFirstName(person1.getFirstName());
Page<IdmIdentityDto> result = identityService.find(filter, null);
assertEquals("Wrong more to find filter", 3, result.getTotalElements());
}
use of eu.bcvsolutions.idm.core.api.dto.filter.IdmIdentityFilter in project CzechIdMng by bcvsolutions.
the class IdentityFilterTest method testManagersForFilter.
@Test
public void testManagersForFilter() {
IdmIdentityDto person = getIdmIdentity("ThisIsTestName009", "ThisIsTestName009", "ThisIsTestName009@gemail.eu", "000000009", false);
IdmIdentityDto manager = getIdmIdentity("ThisIsTestName010", "ThisIsTestName010", "ThisIsTestName010@gemail.eu", "000000010", false);
UUID person_id = person.getId();
manager.getId();
IdmTreeTypeDto type1 = helper.createTreeType("ThisIsTestType004");
IdmTreeNodeDto node2 = helper.createTreeNode(type1, "Somename001", null);
IdmTreeNodeDto node1 = helper.createTreeNode(type1, "ThisIsTestNode004", node2);
helper.createIdentityContact(manager, node2);
helper.createIdentityContact(person, node1);
// contract.setGuarantee(manager_id);
// IdmIdentityContractDto contract2 = idmIdentityContractService.save(contract);
IdmIdentityFilter filter = new IdmIdentityFilter();
// filter.setIncludeGuarantees(true);
filter.setManagersFor(person_id);
filter.setManagersByTreeType(type1.getId());
Page<IdmIdentityDto> result = identityService.find(filter, null);
assertEquals("Wrong ManagersFor", 1, result.getTotalElements());
assertEquals("Wrong ManagersFor user ID", manager.getId(), result.getContent().get(0).getId());
}
use of eu.bcvsolutions.idm.core.api.dto.filter.IdmIdentityFilter in project CzechIdMng by bcvsolutions.
the class IdentityFilterTest method testFirstnameFilter.
@Test
public void testFirstnameFilter() {
IdmIdentityDto person = getIdmIdentity("ThisIsTestName002", "ThisIsTestName002", "ThisIsTestName002@gemail.eu", "000000002", false);
IdmIdentityFilter filter = new IdmIdentityFilter();
filter.setFirstName(person.getFirstName());
Page<IdmIdentityDto> result = identityService.find(filter, null);
assertEquals("Wrong Firstname", 1, result.getTotalElements());
assertEquals("Wrong Firstname user ID", person.getId(), result.getContent().get(0).getId());
}
Aggregations