AuditBarGraphRequestQueryConverter extends AbstractDateRangeFacetQueryConverter<AuditBarGraphRequest> { @Override public SolrQuery convert(AuditBarGraphRequest request) { SolrQuery query = super.convert(request); addListFilterToSolrQuery(query, CLUSTER, request.getClusters()); return query; }  @Override String getDateFieldName(); @Override String getTypeFieldName(); @Override LogType getLogType(); @Override SolrQuery convert(AuditBarGraphRequest request);  }
@Test public void testConvert() { AuditBarGraphRequest request = new AuditBarGraphRequest(); fillBaseLogRequestWithTestData(request); request.setUnit("+1HOUR"); SolrQuery query = underTest.convert(request); assertEquals("?q=*%3A*&facet=true&facet.pivot=%7B%21range%3Dr1%7Drepo&facet.mincount=1&facet.limit=-1&facet.sort=index" + "&facet.range=%7B%21tag%3Dr1%7DevtTime&f.evtTime.facet.range.start=2016-09-13T22%3A00%3A01.000Z&f.evtTime.facet.range.end=2016-09-14T22%3A00%3A01.000Z&f.evtTime.facet.range.gap=%2B1HOUR" + "&rows=0&start=0&fq=cluster%3Acl1", query.toQueryString()); }
@Test public void testConvertWithoutData() { AuditBarGraphRequest request = new AuditBarGraphRequest(); SolrQuery query = underTest.convert(request); assertEquals(Integer.valueOf(0), query.getRows()); assertEquals(-1, query.getFacetLimit()); }