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

    TrendRequest trendRequest = new TrendRequest();
    trendRequest.setTable(TestUtils.TEST_TABLE_NAME);
    trendRequest.setField("os");
    EqualsFilter equalsFilter = new EqualsFilter();
    equalsFilter.setField("version");
    equalsFilter.setValue(1);
    LessThanFilter lessThanFilter = new LessThanFilter();
    lessThanFilter.setTemporal(true);
    lessThanFilter.setField("_timestamp");
    lessThanFilter.setValue(System.currentTimeMillis());
    trendRequest.setFilters(Lists.newArrayList(equalsFilter, lessThanFilter));
    TrendResponse expectedResponse = new TrendResponse();
    Map<String, List<TrendResponse.Count>> trends = new HashMap<String, List<TrendResponse.Count>>();
    List<TrendResponse.Count> counts = Lists.newArrayList();
    counts.add(new TrendResponse.Count(1397606400000L, 2));
    trends.put("android", counts);
    counts = Lists.newArrayList();
    counts.add(new TrendResponse.Count(1397692800000L, 1));
    trends.put("ios", counts);
    expectedResponse.setTrends(trends);
    TrendResponse actualResponse = TrendResponse.class.cast(queryExecutor.execute(trendRequest));
    assertEquals(expectedResponse, actualResponse);
}