test_class.file: modules/flowable-rest/src/test/java/org/flowable/rest/service/api/management/BatchCollectionResourceTest.java
test_class.identifier: BatchCollectionResourceTest
test_class.superclass: extends BaseSpringRestTestCase
test_case.body: @Test
      public void testGetBatches() throws Exception {
          Calendar hourAgo = Calendar.getInstance();
          hourAgo.add(Calendar.HOUR, -1);
  
          Calendar inAnHour = Calendar.getInstance();
          inAnHour.add(Calendar.HOUR, 1);
  
          ObjectNode docNode = objectMapper.createObjectNode();
          docNode.put("test", "value");
          
          Batch batch = managementService.createBatchBuilder()
              .batchType(Batch.PROCESS_MIGRATION_TYPE)
              .searchKey("test")
              .searchKey2("anotherTest")
              .batchDocumentJson(docNode.toString())
              .create();
  
          String url = RestUrls.createRelativeResourceUrl(RestUrls.URL_BATCH_COLLECTION);
          assertResultsPresentInDataResponse(url, batch.getId());
  
          url = RestUrls.createRelativeResourceUrl(RestUrls.URL_BATCH_COLLECTION) + "?createTimeBefore=" + getISODateString(inAnHour.getTime());
          assertResultsPresentInDataResponse(url, batch.getId());
  
          url = RestUrls.createRelativeResourceUrl(RestUrls.URL_BATCH_COLLECTION) + "?createTimeBefore=" + getISODateString(hourAgo.getTime());
          assertResultsPresentInDataResponse(url);
  
          url = RestUrls.createRelativeResourceUrl(RestUrls.URL_BATCH_COLLECTION) + "?createTimeAfter=" + getISODateString(hourAgo.getTime());
          assertResultsPresentInDataResponse(url, batch.getId());
  
          url = RestUrls.createRelativeResourceUrl(RestUrls.URL_BATCH_COLLECTION) + "?createTimeAfter=" + getISODateString(inAnHour.getTime());
          assertResultsPresentInDataResponse(url);
          
          url = RestUrls.createRelativeResourceUrl(RestUrls.URL_BATCH_COLLECTION) + "?batchType=" + Batch.PROCESS_MIGRATION_TYPE;
          assertResultsPresentInDataResponse(url, batch.getId());
          
          url = RestUrls.createRelativeResourceUrl(RestUrls.URL_BATCH_COLLECTION) + "?batchType=unknown";
          assertEmptyResultsPresentInDataResponse(url);
          
          url = RestUrls.createRelativeResourceUrl(RestUrls.URL_BATCH_COLLECTION) + "?searchKey=test";
          assertResultsPresentInDataResponse(url, batch.getId());
          
          url = RestUrls.createRelativeResourceUrl(RestUrls.URL_BATCH_COLLECTION) + "?searchKey=unknown";
          assertEmptyResultsPresentInDataResponse(url);
          
          url = RestUrls.createRelativeResourceUrl(RestUrls.URL_BATCH_COLLECTION) + "?searchKey2=anotherTest";
          assertResultsPresentInDataResponse(url, batch.getId());
          
          url = RestUrls.createRelativeResourceUrl(RestUrls.URL_BATCH_COLLECTION) + "?searchKey2=unknown";
          assertEmptyResultsPresentInDataResponse(url);
  
          url = RestUrls.createRelativeResourceUrl(RestUrls.URL_BATCH_COLLECTION) + "?withoutTenantId=true";
          assertResultsPresentInDataResponse(url, batch.getId());
          
          managementService.deleteBatch(batch.getId());
      }
test_case.class_method_signature: BatchCollectionResourceTest.testGetBatches()
test_case.full_signature: @Test public void testGetBatches()
test_case.identifier: testGetBatches
test_case.invocations: getInstance add getInstance add createObjectNode put create batchDocumentJson searchKey2 searchKey batchType createBatchBuilder toString createRelativeResourceUrl assertResultsPresentInDataResponse getId createRelativeResourceUrl getISODateString getTime assertResultsPresentInDataResponse getId createRelativeResourceUrl getISODateString getTime assertResultsPresentInDataResponse createRelativeResourceUrl getISODateString getTime assertResultsPresentInDataResponse getId createRelativeResourceUrl getISODateString getTime assertResultsPresentInDataResponse createRelativeResourceUrl assertResultsPresentInDataResponse getId createRelativeResourceUrl assertEmptyResultsPresentInDataResponse createRelativeResourceUrl assertResultsPresentInDataResponse getId createRelativeResourceUrl assertEmptyResultsPresentInDataResponse createRelativeResourceUrl assertResultsPresentInDataResponse getId createRelativeResourceUrl assertEmptyResultsPresentInDataResponse createRelativeResourceUrl assertResultsPresentInDataResponse getId deleteBatch getId
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetBatches()
focal_class.declarator: restResponseFactory
focal_class.modifier: @Autowired
      protected
focal_class.original_string: @Autowired
      protected RestResponseFactory restResponseFactory;
focal_class.type: RestResponseFactory
focal_class.var_name: restResponseFactory
focal_class.declarator: managementService
focal_class.modifier: @Autowired
      protected
focal_class.original_string: @Autowired
      protected ManagementService managementService;
focal_class.type: ManagementService
focal_class.var_name: managementService
focal_class.declarator: restApiInterceptor
focal_class.modifier: @Autowired(required=false)
      protected
focal_class.original_string: @Autowired(required=false)
      protected BpmnRestApiInterceptor restApiInterceptor;
focal_class.type: BpmnRestApiInterceptor
focal_class.var_name: restApiInterceptor
focal_class.file: modules/flowable-rest/src/main/java/org/flowable/rest/service/api/management/BatchCollectionResource.java
focal_class.identifier: BatchCollectionResource
focal_class.class_method_signature: BatchCollectionResource.getBatches(@ApiParam(hidden = true) @RequestParam Map<String, String> allRequestParams, HttpServletRequest request)
focal_class.full_signature: @ApiOperation(value = "List batches", tags = { "Batches" }, nickname = "listBatches") @ApiImplicitParams({ @ApiImplicitParam(name = "id", dataType = "string", value = "Only return batch with the given id", paramType = "query"), @ApiImplicitParam(name = "batchType", dataType = "string", value = "Only return batches for the given type", paramType = "query"), @ApiImplicitParam(name = "searchKey", dataType = "string", value = "Only return batches for the given search key", paramType = "query"), @ApiImplicitParam(name = "searchKey2", dataType = "string", value = "Only return batches for the given search key2", paramType = "query"), @ApiImplicitParam(name = "createTimeBefore", dataType = "string", format="date-time", value = "Only return batches created before the given date", paramType = "query"), @ApiImplicitParam(name = "createTimeAfter", dataType = "string", format="date-time", value = "Only batches batches created after the given date", paramType = "query"), @ApiImplicitParam(name = "completeTimeBefore", dataType = "string", format="date-time", value = "Only return batches completed before the given date", paramType = "query"), @ApiImplicitParam(name = "completeTimeAfter", dataType = "string", format="date-time", value = "Only batches batches completed after the given date", paramType = "query"), @ApiImplicitParam(name = "status", dataType = "string", value = "Only return batches for the given status", paramType = "query"), @ApiImplicitParam(name = "tenantId", dataType = "string", value = "Only return batches for the given tenant id", paramType = "query"), @ApiImplicitParam(name = "tenantIdLike", dataType = "string", value = "Only return batches like given search key", paramType = "query"), @ApiImplicitParam(name = "withoutTenantId", dataType = "boolean", value = "If true, only returns batches without a tenantId set. If false, the withoutTenantId parameter is ignored.", paramType = "query") }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the requested batches were returned."), @ApiResponse(code = 400, message = "Indicates an illegal value has been used in a url query parameter. Status description contains additional details about the error.") }) @GetMapping(value = "/management/batches", produces = "application/json") public DataResponse<BatchResponse> getBatches(@ApiParam(hidden = true) @RequestParam Map<String, String> allRequestParams, HttpServletRequest request)
focal_class.identifier: getBatches
focal_class.modifiers: @ApiOperation(value = "List batches", tags = { "Batches" }, nickname = "listBatches") @ApiImplicitParams({ @ApiImplicitParam(name = "id", dataType = "string", value = "Only return batch with the given id", paramType = "query"), @ApiImplicitParam(name = "batchType", dataType = "string", value = "Only return batches for the given type", paramType = "query"), @ApiImplicitParam(name = "searchKey", dataType = "string", value = "Only return batches for the given search key", paramType = "query"), @ApiImplicitParam(name = "searchKey2", dataType = "string", value = "Only return batches for the given search key2", paramType = "query"), @ApiImplicitParam(name = "createTimeBefore", dataType = "string", format="date-time", value = "Only return batches created before the given date", paramType = "query"), @ApiImplicitParam(name = "createTimeAfter", dataType = "string", format="date-time", value = "Only batches batches created after the given date", paramType = "query"), @ApiImplicitParam(name = "completeTimeBefore", dataType = "string", format="date-time", value = "Only return batches completed before the given date", paramType = "query"), @ApiImplicitParam(name = "completeTimeAfter", dataType = "string", format="date-time", value = "Only batches batches completed after the given date", paramType = "query"), @ApiImplicitParam(name = "status", dataType = "string", value = "Only return batches for the given status", paramType = "query"), @ApiImplicitParam(name = "tenantId", dataType = "string", value = "Only return batches for the given tenant id", paramType = "query"), @ApiImplicitParam(name = "tenantIdLike", dataType = "string", value = "Only return batches like given search key", paramType = "query"), @ApiImplicitParam(name = "withoutTenantId", dataType = "boolean", value = "If true, only returns batches without a tenantId set. If false, the withoutTenantId parameter is ignored.", paramType = "query") }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the requested batches were returned."), @ApiResponse(code = 400, message = "Indicates an illegal value has been used in a url query parameter. Status description contains additional details about the error.") }) @GetMapping(value = "/management/batches", produces = "application/json") public
focal_class.parameters: (@ApiParam(hidden = true) @RequestParam Map<String, String> allRequestParams, HttpServletRequest request)
focal_class.return: DataResponse<BatchResponse>
focal_class.signature: DataResponse<BatchResponse> getBatches(@ApiParam(hidden = true) @RequestParam Map<String, String> allRequestParams, HttpServletRequest request)
focal_method.body: @ApiOperation(value = "List batches", tags = { "Batches" }, nickname = "listBatches")
      @ApiImplicitParams({
              @ApiImplicitParam(name = "id", dataType = "string", value = "Only return batch with the given id", paramType = "query"),
              @ApiImplicitParam(name = "batchType", dataType = "string", value = "Only return batches for the given type", paramType = "query"),
              @ApiImplicitParam(name = "searchKey", dataType = "string", value = "Only return batches for the given search key", paramType = "query"),
              @ApiImplicitParam(name = "searchKey2", dataType = "string", value = "Only return batches for the given search key2", paramType = "query"),
              @ApiImplicitParam(name = "createTimeBefore", dataType = "string", format="date-time", value = "Only return batches created before the given date", paramType = "query"),
              @ApiImplicitParam(name = "createTimeAfter", dataType = "string", format="date-time", value = "Only batches batches created after the given date", paramType = "query"),
              @ApiImplicitParam(name = "completeTimeBefore", dataType = "string", format="date-time", value = "Only return batches completed before the given date", paramType = "query"),
              @ApiImplicitParam(name = "completeTimeAfter", dataType = "string", format="date-time", value = "Only batches batches completed after the given date", paramType = "query"),
              @ApiImplicitParam(name = "status", dataType = "string", value = "Only return batches for the given status", paramType = "query"),
              @ApiImplicitParam(name = "tenantId", dataType = "string", value = "Only return batches for the given tenant id", paramType = "query"),
              @ApiImplicitParam(name = "tenantIdLike", dataType = "string", value = "Only return batches like given search key", paramType = "query"),
              @ApiImplicitParam(name = "withoutTenantId", dataType = "boolean", value = "If true, only returns batches without a tenantId set. If false, the withoutTenantId parameter is ignored.", paramType = "query")
      })
      @ApiResponses(value = {
              @ApiResponse(code = 200, message = "Indicates the requested batches were returned."),
              @ApiResponse(code = 400, message = "Indicates an illegal value has been used in a url query parameter. Status description contains additional details about the error.")
      })
      @GetMapping(value = "/management/batches", produces = "application/json")
      public DataResponse<BatchResponse> getBatches(@ApiParam(hidden = true) @RequestParam Map<String, String> allRequestParams, HttpServletRequest request) {
          BatchQuery query = managementService.createBatchQuery();
  
          if (allRequestParams.containsKey("id")) {
              query.batchId(allRequestParams.get("id"));
          }
          if (allRequestParams.containsKey("batchType")) {
              query.batchType(allRequestParams.get("batchType"));
          }
          if (allRequestParams.containsKey("searchKey")) {
              query.searchKey(allRequestParams.get("searchKey"));
          }
          if (allRequestParams.containsKey("searchKey2")) {
              query.searchKey2(allRequestParams.get("searchKey2"));
          }
          if (allRequestParams.containsKey("createTimeBefore")) {
              query.createTimeLowerThan(RequestUtil.getDate(allRequestParams, "createTimeBefore"));
          }
          if (allRequestParams.containsKey("createTimeAfter")) {
              query.createTimeHigherThan(RequestUtil.getDate(allRequestParams, "createTimeAfter"));
          }
          if (allRequestParams.containsKey("completeTimeBefore")) {
              query.completeTimeLowerThan(RequestUtil.getDate(allRequestParams, "completeTimeBefore"));
          }
          if (allRequestParams.containsKey("completeTimeAfter")) {
              query.completeTimeHigherThan(RequestUtil.getDate(allRequestParams, "completeTimeAfter"));
          }
          if (allRequestParams.containsKey("status")) {
              query.status(allRequestParams.get("status"));
          }
          if (allRequestParams.containsKey("tenantId")) {
              query.tenantId(allRequestParams.get("tenantId"));
          }
          if (allRequestParams.containsKey("tenantIdLike")) {
              query.tenantIdLike(allRequestParams.get("tenantIdLike"));
          }
          if (allRequestParams.containsKey("withoutTenantId")) {
              if (Boolean.valueOf(allRequestParams.get("withoutTenantId"))) {
                  query.withoutTenantId();
              }
          }
          
          if (restApiInterceptor != null) {
              restApiInterceptor.accessBatchInfoWithQuery(query);
          }
  
          return paginateList(allRequestParams, query, "id", JobQueryProperties.PROPERTIES, restResponseFactory::createBatchResponse);
      }
focal_method.class_method_signature: BatchCollectionResource.getBatches(@ApiParam(hidden = true) @RequestParam Map<String, String> allRequestParams, HttpServletRequest request)
focal_method.full_signature: @ApiOperation(value = "List batches", tags = { "Batches" }, nickname = "listBatches") @ApiImplicitParams({ @ApiImplicitParam(name = "id", dataType = "string", value = "Only return batch with the given id", paramType = "query"), @ApiImplicitParam(name = "batchType", dataType = "string", value = "Only return batches for the given type", paramType = "query"), @ApiImplicitParam(name = "searchKey", dataType = "string", value = "Only return batches for the given search key", paramType = "query"), @ApiImplicitParam(name = "searchKey2", dataType = "string", value = "Only return batches for the given search key2", paramType = "query"), @ApiImplicitParam(name = "createTimeBefore", dataType = "string", format="date-time", value = "Only return batches created before the given date", paramType = "query"), @ApiImplicitParam(name = "createTimeAfter", dataType = "string", format="date-time", value = "Only batches batches created after the given date", paramType = "query"), @ApiImplicitParam(name = "completeTimeBefore", dataType = "string", format="date-time", value = "Only return batches completed before the given date", paramType = "query"), @ApiImplicitParam(name = "completeTimeAfter", dataType = "string", format="date-time", value = "Only batches batches completed after the given date", paramType = "query"), @ApiImplicitParam(name = "status", dataType = "string", value = "Only return batches for the given status", paramType = "query"), @ApiImplicitParam(name = "tenantId", dataType = "string", value = "Only return batches for the given tenant id", paramType = "query"), @ApiImplicitParam(name = "tenantIdLike", dataType = "string", value = "Only return batches like given search key", paramType = "query"), @ApiImplicitParam(name = "withoutTenantId", dataType = "boolean", value = "If true, only returns batches without a tenantId set. If false, the withoutTenantId parameter is ignored.", paramType = "query") }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the requested batches were returned."), @ApiResponse(code = 400, message = "Indicates an illegal value has been used in a url query parameter. Status description contains additional details about the error.") }) @GetMapping(value = "/management/batches", produces = "application/json") public DataResponse<BatchResponse> getBatches(@ApiParam(hidden = true) @RequestParam Map<String, String> allRequestParams, HttpServletRequest request)
focal_method.identifier: getBatches
focal_method.invocations: createBatchQuery containsKey batchId get containsKey batchType get containsKey searchKey get containsKey searchKey2 get containsKey createTimeLowerThan getDate containsKey createTimeHigherThan getDate containsKey completeTimeLowerThan getDate containsKey completeTimeHigherThan getDate containsKey status get containsKey tenantId get containsKey tenantIdLike get containsKey valueOf get withoutTenantId accessBatchInfoWithQuery paginateList
focal_method.modifiers: @ApiOperation(value = "List batches", tags = { "Batches" }, nickname = "listBatches") @ApiImplicitParams({ @ApiImplicitParam(name = "id", dataType = "string", value = "Only return batch with the given id", paramType = "query"), @ApiImplicitParam(name = "batchType", dataType = "string", value = "Only return batches for the given type", paramType = "query"), @ApiImplicitParam(name = "searchKey", dataType = "string", value = "Only return batches for the given search key", paramType = "query"), @ApiImplicitParam(name = "searchKey2", dataType = "string", value = "Only return batches for the given search key2", paramType = "query"), @ApiImplicitParam(name = "createTimeBefore", dataType = "string", format="date-time", value = "Only return batches created before the given date", paramType = "query"), @ApiImplicitParam(name = "createTimeAfter", dataType = "string", format="date-time", value = "Only batches batches created after the given date", paramType = "query"), @ApiImplicitParam(name = "completeTimeBefore", dataType = "string", format="date-time", value = "Only return batches completed before the given date", paramType = "query"), @ApiImplicitParam(name = "completeTimeAfter", dataType = "string", format="date-time", value = "Only batches batches completed after the given date", paramType = "query"), @ApiImplicitParam(name = "status", dataType = "string", value = "Only return batches for the given status", paramType = "query"), @ApiImplicitParam(name = "tenantId", dataType = "string", value = "Only return batches for the given tenant id", paramType = "query"), @ApiImplicitParam(name = "tenantIdLike", dataType = "string", value = "Only return batches like given search key", paramType = "query"), @ApiImplicitParam(name = "withoutTenantId", dataType = "boolean", value = "If true, only returns batches without a tenantId set. If false, the withoutTenantId parameter is ignored.", paramType = "query") }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the requested batches were returned."), @ApiResponse(code = 400, message = "Indicates an illegal value has been used in a url query parameter. Status description contains additional details about the error.") }) @GetMapping(value = "/management/batches", produces = "application/json") public
focal_method.parameters: (@ApiParam(hidden = true) @RequestParam Map<String, String> allRequestParams, HttpServletRequest request)
focal_method.return: DataResponse<BatchResponse>
focal_method.signature: DataResponse<BatchResponse> getBatches(@ApiParam(hidden = true) @RequestParam Map<String, String> allRequestParams, HttpServletRequest request)