use of io.searchbox.core.search.aggregation.SumAggregation in project herd by FINRAOS.
the class ElasticSearchHelperTest method testGetNestedTagTagIndexSearchResponseDtoSearchResultParameter.
@Test
public void testGetNestedTagTagIndexSearchResponseDtoSearchResultParameter() {
SearchResult searchResult = mock(SearchResult.class);
MetricAggregation metricAggregation = mock(MetricAggregation.class);
SumAggregation tagFacetAggregation = mock(SumAggregation.class);
TermsAggregation tagTypeCodesAggregation = mock(TermsAggregation.class);
when(searchResult.getAggregations()).thenReturn(metricAggregation);
when(metricAggregation.getSumAggregation(TAG_FACET_AGGS)).thenReturn(tagFacetAggregation);
when(tagFacetAggregation.getTermsAggregation(TAGTYPE_CODE_AGGREGATION)).thenReturn(tagTypeCodesAggregation);
List<TagTypeIndexSearchResponseDto> result = elasticsearchHelper.getNestedTagTagIndexSearchResponseDto(searchResult);
assertThat("Result is null.", result, is(notNullValue()));
}
Aggregations