test_class.declarator: totalCancelledTendersByYearController
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private TotalCancelledTendersByYearController totalCancelledTendersByYearController;
test_class.type: TotalCancelledTendersByYearController
test_class.var_name: totalCancelledTendersByYearController
test_class.file: web/src/test/java/org/devgateway/ocds/web/rest/controller/TotalCancelledTendersByYearControllerTest.java
test_class.identifier: TotalCancelledTendersByYearControllerTest
test_class.superclass: extends AbstractEndPointControllerTest
test_case.body: @Test
      public void totalCancelledTendersByYear() throws Exception {
          final List<Document> totalCancelledTendersByYear = totalCancelledTendersByYearController
                  .totalCancelledTendersByYear(new YearFilterPagingRequest());
  
          Assert.assertEquals(0, totalCancelledTendersByYear.size());
      }
test_case.class_method_signature: TotalCancelledTendersByYearControllerTest.totalCancelledTendersByYear()
test_case.full_signature: @Test public void totalCancelledTendersByYear()
test_case.identifier: totalCancelledTendersByYear
test_case.invocations: totalCancelledTendersByYear assertEquals size
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void totalCancelledTendersByYear()
focal_class.file: web/src/main/java/org/devgateway/ocds/web/rest/controller/TotalCancelledTendersByYearController.java
focal_class.identifier: TotalCancelledTendersByYearController
focal_class.class_method_signature: TotalCancelledTendersByYearController.totalCancelledTendersByYear(@ModelAttribute @Valid final YearFilterPagingRequest filter)
focal_class.full_signature: @ApiOperation(value = "Total Cancelled tenders by year. The tender amount is read from tender.value." + "The tender status has to be 'cancelled'. The year is retrieved from tender.tenderPeriod.startDate.") @RequestMapping(value = "/api/totalCancelledTendersByYear", method = { RequestMethod.POST, RequestMethod.GET }, produces = "application/json") public List<Document> totalCancelledTendersByYear(@ModelAttribute @Valid final YearFilterPagingRequest filter)
focal_class.identifier: totalCancelledTendersByYear
focal_class.modifiers: @ApiOperation(value = "Total Cancelled tenders by year. The tender amount is read from tender.value." + "The tender status has to be 'cancelled'. The year is retrieved from tender.tenderPeriod.startDate.") @RequestMapping(value = "/api/totalCancelledTendersByYear", method = { RequestMethod.POST, RequestMethod.GET }, produces = "application/json") public
focal_class.parameters: (@ModelAttribute @Valid final YearFilterPagingRequest filter)
focal_class.return: List<Document>
focal_class.signature: List<Document> totalCancelledTendersByYear(@ModelAttribute @Valid final YearFilterPagingRequest filter)
focal_class.superclass: extends GenericOCDSController
focal_method.body: @ApiOperation(value = "Total Cancelled tenders by year. The tender amount is read from tender.value."
              + "The tender status has to be 'cancelled'. The year is retrieved from tender.tenderPeriod.startDate.")
      @RequestMapping(value = "/api/totalCancelledTendersByYear", method = { RequestMethod.POST, RequestMethod.GET },
              produces = "application/json")
      public List<Document> totalCancelledTendersByYear(@ModelAttribute @Valid final YearFilterPagingRequest filter) {
  
  
          DBObject project = new BasicDBObject();
          addYearlyMonthlyProjection(filter, project, ref(MongoConstants.FieldNames.TENDER_PERIOD_START_DATE));
          project.put(MongoConstants.FieldNames.TENDER_VALUE_AMOUNT, 1);
  
          Aggregation agg = newAggregation(
                  match(where(MongoConstants.FieldNames.TENDER_STATUS).is(Tender.Status.cancelled.toString())
                          .and(MongoConstants.FieldNames.TENDER_PERIOD_START_DATE).exists(true)
                          .andOperator(getYearDefaultFilterCriteria(filter,
                                  MongoConstants.FieldNames.TENDER_PERIOD_START_DATE))),
                  new CustomOperation(new Document("$project", project)),
                  getYearlyMonthlyGroupingOperation(filter).
                  sum(ref(MongoConstants.FieldNames.TENDER_VALUE_AMOUNT)).as(Keys.TOTAL_CANCELLED_TENDERS_AMOUNT),
                  transformYearlyGrouping(filter).andInclude(Keys.TOTAL_CANCELLED_TENDERS_AMOUNT),
                  getSortByYearMonth(filter));
  
         return releaseAgg(agg);
      }
focal_method.class_method_signature: TotalCancelledTendersByYearController.totalCancelledTendersByYear(@ModelAttribute @Valid final YearFilterPagingRequest filter)
focal_method.full_signature: @ApiOperation(value = "Total Cancelled tenders by year. The tender amount is read from tender.value." + "The tender status has to be 'cancelled'. The year is retrieved from tender.tenderPeriod.startDate.") @RequestMapping(value = "/api/totalCancelledTendersByYear", method = { RequestMethod.POST, RequestMethod.GET }, produces = "application/json") public List<Document> totalCancelledTendersByYear(@ModelAttribute @Valid final YearFilterPagingRequest filter)
focal_method.identifier: totalCancelledTendersByYear
focal_method.invocations: addYearlyMonthlyProjection ref put newAggregation match andOperator exists and is where toString getYearDefaultFilterCriteria as sum getYearlyMonthlyGroupingOperation ref andInclude transformYearlyGrouping getSortByYearMonth releaseAgg
focal_method.modifiers: @ApiOperation(value = "Total Cancelled tenders by year. The tender amount is read from tender.value." + "The tender status has to be 'cancelled'. The year is retrieved from tender.tenderPeriod.startDate.") @RequestMapping(value = "/api/totalCancelledTendersByYear", method = { RequestMethod.POST, RequestMethod.GET }, produces = "application/json") public
focal_method.parameters: (@ModelAttribute @Valid final YearFilterPagingRequest filter)
focal_method.return: List<Document>
focal_method.signature: List<Document> totalCancelledTendersByYear(@ModelAttribute @Valid final YearFilterPagingRequest filter)