LocationInfowindowController extends GenericOCDSController { @ApiOperation(value = "Displays the planning items, filtered by location. See the location filter " + "for the options to filter by") @RequestMapping(value = "/api/planningByLocation", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json") @JsonView(Views.Public.class) public List<DBObject> planningByLocation( @ModelAttribute @Valid final YearFilterPagingRequest filter) { Aggregation agg = newAggregation( match(where("planning.budget").exists(true).orOperator( where("tender.items.deliveryLocation._id").exists(true), where("planning.budget.projectLocation._id").exists(true) ) .andOperator(getYearDefaultFilterCriteria(filter, "planning.bidPlanProjectDateApprove"))), project("planning").andExclude(Fields.UNDERSCORE_ID), skip(filter.getSkip()), limit(filter.getPageSize()) ); AggregationResults<DBObject> results = mongoTemplate.aggregate(agg, "release", DBObject.class); List<DBObject> tagCount = results.getMappedResults(); return tagCount; }  @ApiOperation(value = "Displays the tenders filtered by location. See the location filter " + "for the options to filter by") @RequestMapping(value = "/api/tendersByLocation", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json") @JsonView(Views.Public.class) List<DBObject> tendersByLocation(
            @ModelAttribute @Valid final YearFilterPagingRequest filter); @ApiOperation(value = "Displays the planning items, filtered by location. See the location filter " + "for the options to filter by") @RequestMapping(value = "/api/planningByLocation", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json") @JsonView(Views.Public.class) List<DBObject> planningByLocation(
            @ModelAttribute @Valid final YearFilterPagingRequest filter); @ApiOperation(value = "Displays the awards, filtered by location. See the location filter " + "for the options to filter by") @RequestMapping(value = "/api/awardsByLocation", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json") @JsonView(Views.Public.class) List<DBObject> awardsByLocation(
            @ModelAttribute @Valid final YearFilterPagingRequest filter);  }
@Test public void planningByLocation() throws Exception { final List<DBObject> planningByLocation = locationInfowindowController.planningByLocation( new YearFilterPagingRequest()); Assert.assertEquals(1, planningByLocation.size()); final DBObject first = planningByLocation.get(0); }