@Test
public void verifyGetAggregateClauseWithEnrollmentDimension()
{

    ProgramIndicator programIndicator = createProgramIndicator( 'A', programA, "9.0", null );
    programIndicator.setAnalyticsType( AnalyticsType.ENROLLMENT );
    EventQueryParams params = new EventQueryParams.Builder( createRequestParams() )
        .withProgramIndicator( programIndicator )
        .build();
    when( programIndicatorService.getAnalyticsSql( programIndicator.getExpression(), programIndicator,
        params.getEarliestStartDate(), params.getLatestEndDate() ) )
            .thenReturn( "select * from table" );
    String clause = subject.getAggregateClause( params );
    assertThat( clause, is( "avg(select * from table)" ) );
}