@Test
public void convertAnalyticsRequestWithOuLevelToDataQueryParam()
{

    mockDimensionService();
    when( organisationUnitService.getOrganisationUnitLevelByLevel( 2 ) )
        .thenReturn( buildOrgUnitLevel( 2, "level2UID", "District", null ) );
    when( organisationUnitService.getOrganisationUnitLevelByLevelOrUid( "2" ) ).thenReturn( 2 );
    when( organisationUnitService.getOrganisationUnitsAtLevels( Mockito.anyList(), Mockito.anyList() ) )
        .thenReturn( Lists.newArrayList( new OrganisationUnit(), new OrganisationUnit() ) );
    rb.addOuFilter( "LEVEL-2;ImspTQPwCqd" );
    rb.addDimension( concatenateUuid( DATA_ELEMENT_1, DATA_ELEMENT_2, DATA_ELEMENT_3 ) );
    rb.addPeDimension( PERIOD_DIMENSION );
    DataQueryRequest request = DataQueryRequest.newBuilder().filter( rb.getFilterParams() )
        .dimension( rb.getDimensionParams() ).build();
    DataQueryParams params = target.getFromRequest( request );
    DimensionalObject filter = params.getFilters().get( 0 );
    assertThat( filter.getDimensionalKeywords().getGroupBy(), hasSize( 1 ) );
    assertThat( filter.getDimensionalKeywords().getGroupBy().get( 0 ),
        allOf( hasProperty( "name", is( "District" ) ), hasProperty( "uid", is( "level2UID" ) ),
            hasProperty( "code", is( nullValue() ) ) ) );
}