use of com.zimbra.client.ZSearchResult in project zm-mailbox by Zimbra.
the class TestDraftCount method checkMessageCount.
private void checkMessageCount(String query, int expected) throws Exception {
ZSearchParams params = new ZSearchParams(query);
params.setTypes("message");
params.setOffset(0);
params.setSortBy(SearchSortBy.rcptAsc);
ZSearchResult results = mbox.search(params);
assertEquals(expected, results.getHits().size());
params.setSortBy(SearchSortBy.rcptDesc);
results = mbox.search(params);
assertEquals(expected, results.getHits().size());
}
Aggregations