use of org.motechproject.mds.rest.RestResponse in project motech by motech.
the class MdsRestBundleIT method verifyMultiLookup.
private void verifyMultiLookup(int lookupParam, String... expectedStrings) throws Exception {
HttpGet get = new HttpGet(ENTITY_URL + "?lookup=byInt&intField=" + lookupParam + "&sort=strField&order=ASC");
String responseBody = getHttpClient().execute(get, new BasicResponseHandler());
RestResponse response = OBJECT_MAPPER.readValue(responseBody, RestResponse.class);
List strings = Lambda.extract(response.getData(), PropertyUtils.getProperty(on(RestProjection.class), "strField"));
assertEquals(asList(expectedStrings), strings);
}
Aggregations