@Test
public void shouldReturnDateHistogramFacetForGivenQuery() throws ParseException {
// given
String facetName = "sequenceCodeFacet";
SearchQuery searchQuery = new NativeSearchQueryBuilder().withQuery(matchAllQuery())
.withFacet(new HistogramFacetRequestBuilder(facetName).field("date").interval(1).timeUnit(TimeUnit.HOURS).build()
).build();
// when
FacetedPage<LogEntity> result = elasticsearchTemplate.queryForPage(searchQuery, LogEntity.class);
// then
assertThat(result.getNumberOfElements(), is(equalTo(4)));