@Test
public void testTrendActionWithField() throws FoxtrotException, JsonProcessingException {

    TrendRequest trendRequest = new TrendRequest();
    trendRequest.setTable(TestUtils.TEST_TABLE_NAME);
    BetweenFilter betweenFilter = new BetweenFilter();
    betweenFilter.setFrom(1L);
    betweenFilter.setTo(System.currentTimeMillis());
    betweenFilter.setTemporal(true);
    betweenFilter.setField("_timestamp");
    trendRequest.setField("os");
    trendRequest.setFilters(Collections.<Filter>singletonList(betweenFilter));
    TrendResponse expectedResponse = new TrendResponse();
    Map<String, List<TrendResponse.Count>> trends = Maps.newHashMap();
    List<TrendResponse.Count> counts = Lists.newArrayList();
    counts.add(new TrendResponse.Count(1397586600000L, 6));
    counts.add(new TrendResponse.Count(1398623400000L, 1));
    trends.put("android", counts);
    counts = Lists.newArrayList();
    counts.add(new TrendResponse.Count(1397673000000L, 1));
    counts.add(new TrendResponse.Count(1397932200000L, 1));
    counts.add(new TrendResponse.Count(1398623400000L, 2));
    trends.put("ios", counts);
    expectedResponse.setTrends(trends);
    TrendResponse actualResponse = TrendResponse.class.cast(getQueryExecutor().execute(trendRequest));
    filterNonZeroCounts(actualResponse.getTrends()
                                .get("android"));
    filterNonZeroCounts(actualResponse.getTrends()
                                .get("ios"));
    assertEquals(expectedResponse, actualResponse);
}