use of eu.bcvsolutions.idm.core.eav.api.dto.filter.IdmFormValueFilter in project CzechIdMng by bcvsolutions.
the class IdmFormValueControllerRestTest method testFindByDateValue.
@Test
public void testFindByDateValue() {
IdmFormValueDto value = prepareDto(PersistentType.DATETIME);
ZonedDateTime now = ZonedDateTime.now().truncatedTo(ChronoUnit.MILLIS);
value.setDateValue(now);
IdmFormValueDto valueOne = createDto(value);
value = prepareDto(PersistentType.DATETIME);
value.setDateValue(now.plusDays(2));
// other
createDto(value);
//
IdmFormValueFilter<?> filter = new IdmFormValueFilter<>();
filter.setDateValue(now);
filter.setTransactionId(TransactionContextHolder.getContext().getTransactionId());
List<IdmFormValueDto> results = find(filter);
//
Assert.assertEquals(1, results.size());
Assert.assertTrue(results.stream().anyMatch(r -> r.getId().equals(valueOne.getId())));
}
use of eu.bcvsolutions.idm.core.eav.api.dto.filter.IdmFormValueFilter in project CzechIdMng by bcvsolutions.
the class IdmFormValueControllerRestTest method testFindByStringValue.
@Test
public void testFindByStringValue() {
IdmFormValueDto value = prepareDto(PersistentType.TEXT);
String text = getHelper().createName();
value.setValue(text);
IdmFormValueDto valueOne = createDto(value);
// other
createDto();
//
IdmFormValueFilter<?> filter = new IdmFormValueFilter<>();
filter.setStringValue(text);
List<IdmFormValueDto> results = find(filter);
//
Assert.assertEquals(1, results.size());
Assert.assertTrue(results.stream().anyMatch(r -> r.getId().equals(valueOne.getId())));
}
use of eu.bcvsolutions.idm.core.eav.api.dto.filter.IdmFormValueFilter in project CzechIdMng by bcvsolutions.
the class IdmFormValueControllerRestTest method testFindByUuidValue.
@Test
public void testFindByUuidValue() {
IdmFormValueDto value = prepareDto(PersistentType.UUID);
value.setUuidValue(UUID.randomUUID());
IdmFormValueDto valueOne = createDto(value);
value = prepareDto(PersistentType.UUID);
value.setUuidValue(UUID.randomUUID());
// other
createDto(value);
//
IdmFormValueFilter<?> filter = new IdmFormValueFilter<>();
filter.setUuidValue(valueOne.getUuidValue());
List<IdmFormValueDto> results = find(filter);
//
Assert.assertEquals(1, results.size());
Assert.assertTrue(results.stream().anyMatch(r -> r.getId().equals(valueOne.getId())));
}
Aggregations