@Test
public void testGetAggregation()
{

    // Create a mock aggregation.
    Terms aggregation = mock(Terms.class);
    // Create mock aggregations.
    Aggregations aggregations = mock(Aggregations.class);
    when(aggregations.get(AGGREGATION_NAME)).thenReturn(aggregation);
    // Create a mock search response.
    SearchResponse searchResponse = mock(SearchResponse.class);
    when(searchResponse.getAggregations()).thenReturn(aggregations);
    // Call the method under test.
    Terms result = elasticsearchHelper.getAggregation(searchResponse, AGGREGATION_NAME);
    // Verify the external calls.
    verifyNoMoreInteractionsHelper();
    // Validate the result.
    assertEquals(aggregation, result);
}