@Test
public void testQueryCaching() throws QueryStoreException, JsonProcessingException {

    Query query = new Query();
    query.setTable(TestUtils.TEST_TABLE_NAME);
    ResultSort resultSort = new ResultSort();
    resultSort.setOrder(ResultSort.Order.desc);
    resultSort.setField("_timestamp");
    query.setSort(resultSort);
    EqualsFilter equalsFilter = new EqualsFilter();
    equalsFilter.setField("os");
    equalsFilter.setValue("ios");
    query.setFilters(Lists.<Filter>newArrayList(equalsFilter));
    query.setFrom(1);
    query.setLimit(1);
    List<Document> documents = new ArrayList<Document>();
    documents.add(TestUtils.getDocument("D", 1397658118003L, new Object[]{"os", "ios", "version", 1, "device", "iphone"}, mapper));
    QueryResponse actualResponse = QueryResponse.class.cast(queryExecutor.execute(query));
    compare(documents, actualResponse.getDocuments());
}