Search in sources :

Example 36 with IdmIdentityRoleDto

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

the class DtoUtilsUnitTest method testEmbeddedWithtDefault.

@Test
public void testEmbeddedWithtDefault() {
    IdmIdentityRoleDto dto = new IdmIdentityRoleDto();
    // 
    assertNull(DtoUtils.getEmbedded(dto, PROPERTY, IdmIdentityContractDto.class, null));
}
Also used : IdmIdentityRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto) IdmIdentityContractDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto) AbstractUnitTest(eu.bcvsolutions.idm.test.api.AbstractUnitTest) Test(org.junit.Test)

Example 37 with IdmIdentityRoleDto

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

the class DtoUtilsUnitTest method testEmbedded.

@Test
public void testEmbedded() {
    IdmIdentityRoleDto dto = new IdmIdentityRoleDto();
    IdmIdentityContractDto contract = new IdmIdentityContractDto(UUID.randomUUID());
    dto.getEmbedded().put(PROPERTY, contract);
    // 
    IdmIdentityContractDto embedded = DtoUtils.getEmbedded(dto, PROPERTY, IdmIdentityContractDto.class);
    assertEquals(contract, embedded);
}
Also used : IdmIdentityRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto) IdmIdentityContractDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto) AbstractUnitTest(eu.bcvsolutions.idm.test.api.AbstractUnitTest) Test(org.junit.Test)

Example 38 with IdmIdentityRoleDto

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

the class EntityUtilsUnitTest method testIsValidWithoutDates.

@Test
public void testIsValidWithoutDates() {
    IdmIdentityRoleDto role = new IdmIdentityRoleDto();
    // 
    assertTrue(EntityUtils.isValid(role));
}
Also used : IdmIdentityRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto) AbstractUnitTest(eu.bcvsolutions.idm.test.api.AbstractUnitTest) Test(org.junit.Test)

Example 39 with IdmIdentityRoleDto

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

the class EntityUtilsUnitTest method testIsValidInFuture.

@Test
public void testIsValidInFuture() {
    IdmIdentityRoleDto role = new IdmIdentityRoleDto();
    role.setValidFrom(new LocalDate().plusDays(1));
    role.setValidTill(new LocalDate().plusDays(2));
    // 
    assertTrue(EntityUtils.isValidInFuture(role));
}
Also used : IdmIdentityRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto) LocalDate(org.joda.time.LocalDate) AbstractUnitTest(eu.bcvsolutions.idm.test.api.AbstractUnitTest) Test(org.junit.Test)

Example 40 with IdmIdentityRoleDto

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

the class EntityUtilsUnitTest method testValidableNotChanged.

@Test
public void testValidableNotChanged() {
    LocalDate now = new LocalDate();
    IdmIdentityRoleDto role = new IdmIdentityRoleDto();
    role.setValidFrom(now.plusDays(1));
    role.setValidTill(now.plusDays(2));
    // 
    IdmIdentityRoleDto role2 = new IdmIdentityRoleDto();
    role.setValidFrom(now.plusDays(1));
    role.setValidTill(now.plusDays(2));
    // 
    assertTrue(EntityUtils.validableChanged(role, role2));
}
Also used : IdmIdentityRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto) LocalDate(org.joda.time.LocalDate) AbstractUnitTest(eu.bcvsolutions.idm.test.api.AbstractUnitTest) Test(org.junit.Test)

Aggregations

IdmIdentityRoleDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityRoleDto)122 Test (org.junit.Test)94 IdmIdentityDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto)90 IdmRoleDto (eu.bcvsolutions.idm.core.api.dto.IdmRoleDto)72 AbstractIntegrationTest (eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)71 IdmIdentityContractDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto)54 IdmAutomaticRoleAttributeDto (eu.bcvsolutions.idm.core.api.dto.IdmAutomaticRoleAttributeDto)30 LocalDate (org.joda.time.LocalDate)21 SysSystemDto (eu.bcvsolutions.idm.acc.dto.SysSystemDto)19 TestResource (eu.bcvsolutions.idm.acc.entity.TestResource)16 IdmFormAttributeDto (eu.bcvsolutions.idm.core.eav.api.dto.IdmFormAttributeDto)15 AccIdentityAccountFilter (eu.bcvsolutions.idm.acc.dto.filter.AccIdentityAccountFilter)13 UUID (java.util.UUID)13 AbstractUnitTest (eu.bcvsolutions.idm.test.api.AbstractUnitTest)12 AccAccountDto (eu.bcvsolutions.idm.acc.dto.AccAccountDto)11 SysSystemMappingDto (eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto)10 Transactional (org.springframework.transaction.annotation.Transactional)10 AccIdentityAccountDto (eu.bcvsolutions.idm.acc.dto.AccIdentityAccountDto)9 IdmIdentityRoleFilter (eu.bcvsolutions.idm.core.api.dto.filter.IdmIdentityRoleFilter)8 AbstractCoreWorkflowIntegrationTest (eu.bcvsolutions.idm.core.AbstractCoreWorkflowIntegrationTest)7