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