use of org.motechproject.mds.testutil.records.Record in project motech by motech.
the class InMemoryQueryFilterTest method record.
private Record record(String value, Long id) {
Record record = new Record();
record.setValue(value);
record.setId(id);
return record;
}
use of org.motechproject.mds.testutil.records.Record in project motech by motech.
the class InMemoryQueryFilterTest method shouldOrderByFieldDesc.
@Test
public void shouldOrderByFieldDesc() {
QueryParams queryParams = new QueryParams(new Order("value", Order.Direction.DESC));
List<Record> result = InMemoryQueryFilter.filter(testCollection, queryParams);
assertListByValues(result, asList("zet", "test", "something", "nullRecord", "hmm", "hmm", "aaa"));
assertListByIds(result, asList(1L, 2L, 3L, null, 5L, 6L, 4L));
}
use of org.motechproject.mds.testutil.records.Record in project motech by motech.
the class AbstractObjectValueGeneratorTest method shouldReturnCorrectValueWhenPropertyIsNotSet.
@Test
public void shouldReturnCorrectValueWhenPropertyIsNotSet() {
Object actual = getGenerator().generate(null, new Record(), null);
assertNotNull(actual);
assertEquals(getExpectedValue(true), actual);
}
use of org.motechproject.mds.testutil.records.Record in project motech by motech.
the class MdsDataProviderTest method testSingleResultLookup.
@Test
public void testSingleResultLookup() {
Map<String, String> lookupMap = new HashMap<>();
lookupMap.put("field", PARAM_VALUE);
Object result = dataProvider.lookup(Record.class.getName(), "singleLookup", lookupMap);
assertNotNull(result);
assertTrue("Wrong type returned", result instanceof Record);
Record record = (Record) result;
assertEquals("single", record.getValue());
}
use of org.motechproject.mds.testutil.records.Record in project motech by motech.
the class MdsRestFacadeTest method testRecord.
private Record testRecord() {
Record record = new Record();
record.setValue("restTest");
// dates will be ignored
record.setDateIgnoredByRest(new Date());
return record;
}
Aggregations