@Test
public void implicitQueryResultLimit() throws Throwable {

    try {
        LuceneDocumentIndexService.setImplicitQueryResultLimit((int) (this.serviceCount / 2));
        setUpHost(false);
        URI factoryUri = UriUtils.buildUri(this.host, ExampleService.FACTORY_LINK);
        doThroughputPost(false, factoryUri, null, null);
        // a GET to the factory is a query without a result limit explicitly set. Since we
        // created 2x the documents of the new, low, implicit result limit, we expect failure
        TestRequestSender sender = this.host.getTestRequestSender();
        sender.sendAndWaitFailure(Operation.createGet(factoryUri));
    } finally {
        LuceneDocumentIndexService.setImplicitQueryResultLimit(
                LuceneDocumentIndexService.DEFAULT_QUERY_RESULT_LIMIT);
    }
}