use of webpiecesxxxxxpackage.json.SearchRequest 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);
}
use of webpiecesxxxxxpackage.json.SearchRequest in project webpieces by deanhiller.
the class Requests method createSearchRequest.
public static SearchRequest createSearchRequest() {
SearchRequest req = new SearchRequest();
req.setQuery("my query");
return req;
}
Aggregations