Search in sources :

Example 31 with IdmIdentityFilter

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());
}
Also used : IdmTreeTypeDto(eu.bcvsolutions.idm.core.api.dto.IdmTreeTypeDto) IdmIdentityFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmIdentityFilter) IdmTreeNodeDto(eu.bcvsolutions.idm.core.api.dto.IdmTreeNodeDto) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) Test(org.junit.Test) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)

Example 32 with IdmIdentityFilter

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());
}
Also used : IdmTreeTypeDto(eu.bcvsolutions.idm.core.api.dto.IdmTreeTypeDto) IdmIdentityFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmIdentityFilter) IdmTreeNodeDto(eu.bcvsolutions.idm.core.api.dto.IdmTreeNodeDto) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) UUID(java.util.UUID) Test(org.junit.Test) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)

Example 33 with IdmIdentityFilter

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());
}
Also used : IdmIdentityFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmIdentityFilter) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) Test(org.junit.Test) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)

Example 34 with IdmIdentityFilter

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());
}
Also used : IdmTreeTypeDto(eu.bcvsolutions.idm.core.api.dto.IdmTreeTypeDto) IdmIdentityFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmIdentityFilter) IdmTreeNodeDto(eu.bcvsolutions.idm.core.api.dto.IdmTreeNodeDto) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) UUID(java.util.UUID) Test(org.junit.Test) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)

Example 35 with IdmIdentityFilter

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());
}
Also used : IdmIdentityFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmIdentityFilter) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) Test(org.junit.Test) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)

Aggregations

IdmIdentityFilter (eu.bcvsolutions.idm.core.api.dto.filter.IdmIdentityFilter)39 IdmIdentityDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto)31 AbstractIntegrationTest (eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)26 Test (org.junit.Test)26 IdmTreeNodeDto (eu.bcvsolutions.idm.core.api.dto.IdmTreeNodeDto)9 IdmTreeTypeDto (eu.bcvsolutions.idm.core.api.dto.IdmTreeTypeDto)8 UUID (java.util.UUID)7 IdmRoleDto (eu.bcvsolutions.idm.core.api.dto.IdmRoleDto)6 SysSyncIdentityConfigDto (eu.bcvsolutions.idm.acc.dto.SysSyncIdentityConfigDto)5 SysSyncLogDto (eu.bcvsolutions.idm.acc.dto.SysSyncLogDto)5 SysSystemDto (eu.bcvsolutions.idm.acc.dto.SysSystemDto)5 DefaultSynchronizationServiceTest (eu.bcvsolutions.idm.acc.service.impl.DefaultSynchronizationServiceTest)5 IdmIdentityContractDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto)5 IdmIdentity (eu.bcvsolutions.idm.core.model.entity.IdmIdentity)5 PageRequest (org.springframework.data.domain.PageRequest)5 IdmIdentityRoleDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto)4 Sort (org.springframework.data.domain.Sort)3 JsonGenerator (com.fasterxml.jackson.core.JsonGenerator)2 IdmScriptAuthorityDto (eu.bcvsolutions.idm.core.api.dto.IdmScriptAuthorityDto)2 IdmScriptDto (eu.bcvsolutions.idm.core.api.dto.IdmScriptDto)2