AbstractJdbcEventAnalyticsManager { protected List<String> getSelectColumns( EventQueryParams params ) { return getSelectColumns( params, false ); } AbstractJdbcEventAnalyticsManager( @Qualifier( "readOnlyJdbcTemplate" ) JdbcTemplate jdbcTemplate,
        StatementBuilder statementBuilder, ProgramIndicatorService programIndicatorService,
        ProgramIndicatorSubqueryBuilder programIndicatorSubqueryBuilder ); Grid getAggregatedEventData( EventQueryParams params, Grid grid, int maxLimit );  }
@Test public void verifyGetColumnsWithAttributeOrgUnitTypeAndCoordinatesReturnsFetchesCoordinatesFromOrgUnite() { DataElement deA = createDataElement( 'A', ValueType.ORGANISATION_UNIT, AggregationType.NONE ); DimensionalObject periods = new BaseDimensionalObject( DimensionalObject.PERIOD_DIM_ID, DimensionType.PERIOD, Lists.newArrayList( MonthlyPeriodType.getPeriodFromIsoString( "201701" ) ) ); DimensionalObject orgUnits = new BaseDimensionalObject( DimensionalObject.ORGUNIT_DIM_ID, DimensionType.ORGANISATION_UNIT, "ouA", Lists.newArrayList( createOrganisationUnit( 'A' ) ) ); QueryItem qiA = new QueryItem( deA, null, deA.getValueType(), deA.getAggregationType(), null ); EventQueryParams params = new EventQueryParams.Builder() .addDimension( periods ) .addDimension( orgUnits ) .addItem( qiA ) .withCoordinateField( deA.getUid() ) .withSkipData( true ) .withSkipMeta( false ) .build(); final List<String> columns = this.subject.getSelectColumns( params ); assertThat( columns, hasSize( 3 ) ); assertThat( columns, containsInAnyOrder( "ax.\"pe\"", "ax.\"ou\"", "'[' || round(ST_X(ST_Centroid(\"" + deA.getUid() + "_geom" + "\"))::numeric, 6) || ',' || round(ST_Y(ST_Centroid(\"" + deA.getUid() + "_geom" + "\"))::numeric, 6) || ']' as \"" + deA.getUid() + "_geom" + "\"" ) ); }