use of webpiecesxxxxxpackage.json.SearchResponse in project webpieces by deanhiller.
the class TestLesson8JsonHttp2 method testSynchronousController.
/**
* Testing a synchronous controller may be easier especially if there is no remote communication.
*/
@Test
public void testSynchronousController() {
SearchRequest req = new SearchRequest();
req.setQuery("my query");
SearchResponse resp = search(req);
Assert.assertEquals("match1", resp.getMatches().get(0));
// check metrics are wired correctly here as well
RequiredSearch result = metrics.get("testCounter");
Counter counter = result.counter();
Assert.assertEquals(1.0, counter.count(), 0.1);
}
Aggregations