@Test
public void testQueryContainsFilter() throws FoxtrotException, 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);
    ContainsFilter containsFilter = new ContainsFilter();
    containsFilter.setField("os");
    containsFilter.setValue("*droid*");
    query.setFilters(Lists.<Filter>newArrayList(containsFilter));
    List<Document> documents = new ArrayList<Document>();
    documents.add(
            TestUtils.getDocument("C", 1397658118002L, new Object[]{"os", "android", "version", 2, "device", "nexus"}, getMapper()));
    documents.add(
            TestUtils.getDocument("B", 1397658118001L, new Object[]{"os", "android", "version", 1, "device", "galaxy"}, getMapper()));
    documents.add(
            TestUtils.getDocument("A", 1397658118000L, new Object[]{"os", "android", "version", 1, "device", "nexus"}, getMapper()));
    documents.add(
            TestUtils.getDocument("Z", 1397658117004L, new Object[]{"os", "android", "device", "nexus", "battery", 24}, getMapper()));
    documents.add(
            TestUtils.getDocument("Y", 1397658117003L, new Object[]{"os", "android", "device", "nexus", "battery", 48}, getMapper()));
    documents.add(
            TestUtils.getDocument("X", 1397658117002L, new Object[]{"os", "android", "device", "nexus", "battery", 74}, getMapper()));
    documents.add(
            TestUtils.getDocument("W", 1397658117001L, new Object[]{"os", "android", "device", "nexus", "battery", 99}, getMapper()));
    QueryResponse actualResponse = QueryResponse.class.cast(getQueryExecutor().execute(query));
    compare(documents, actualResponse.getDocuments());
}