use of com.ibm.cohort.datarow.model.DataRow in project quality-measure-and-cohort-service by Alvearie.
the class DataRowModelResolverTest method testInvalidObjectAsTypeStrict.
@Test
public void testInvalidObjectAsTypeStrict() {
DataRow row = new SimpleDataRow(Collections.emptyMap());
assertThrows(InvalidCast.class, () -> resolver.as(row, String.class, true));
}
use of com.ibm.cohort.datarow.model.DataRow in project quality-measure-and-cohort-service by Alvearie.
the class DataRowRetrieveProviderTest method testRetrieveFilterByProvidedCodes_dataForCodeIsString.
@Test
public void testRetrieveFilterByProvidedCodes_dataForCodeIsString() {
String maleId = "789";
List<Object> people = makePeopleTestData(maleId);
data.put(DATATYPE_PERSON, people);
List<Code> codes = Arrays.asList(GENDER_MALE).stream().map(this::code).collect(Collectors.toList());
Iterable<Object> rows = retrieveProvider.retrieve(CONTEXT_CLAIM, FIELD_PERSON_ID, null, DATATYPE_PERSON, null, FIELD_GENDER, codes, null, null, null, null, null);
int count = 0;
for (Object obj : rows) {
count++;
DataRow actual = (DataRow) obj;
assertEquals(maleId, actual.getValue(FIELD_PERSON_ID));
}
assertEquals(1, count);
}
Aggregations