test_class.file: modules/flowable-rest/src/test/java/org/flowable/rest/service/api/repository/ModelCollectionResourceTest.java
test_class.identifier: ModelCollectionResourceTest
test_class.superclass: extends BaseSpringRestTestCase
test_case.body: @Test
      @Deployment(resources = { "org/flowable/rest/service/api/repository/oneTaskProcess.bpmn20.xml" })
      public void testCreateModel() throws Exception {
          Model model = null;
          try {
  
              Calendar createTime = Calendar.getInstance();
              createTime.set(Calendar.MILLISECOND, 0);
              processEngineConfiguration.getClock().setCurrentTime(createTime.getTime());
  
              // Create create request
              ObjectNode requestNode = objectMapper.createObjectNode();
              requestNode.put("name", "Model name");
              requestNode.put("category", "Model category");
              requestNode.put("key", "Model key");
              requestNode.put("metaInfo", "Model metainfo");
              requestNode.put("deploymentId", deploymentId);
              requestNode.put("version", 2);
              requestNode.put("tenantId", "myTenant");
  
              HttpPost httpPost = new HttpPost(SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_MODEL_COLLECTION));
              httpPost.setEntity(new StringEntity(requestNode.toString()));
              CloseableHttpResponse response = executeRequest(httpPost, HttpStatus.SC_CREATED);
              JsonNode responseNode = objectMapper.readTree(response.getEntity().getContent());
              closeResponse(response);
              assertThat(responseNode).isNotNull();
              assertThatJson(responseNode)
                      .when(Option.IGNORING_EXTRA_FIELDS)
                      .isEqualTo("{"
                              + "name: 'Model name',"
                              + "key: 'Model key',"
                              + "category: 'Model category',"
                              + "version: 2,"
                              + "metaInfo: 'Model metainfo',"
                              + "deploymentId: '" + deploymentId + "',"
                              + "tenantId: 'myTenant',"
                              + "url: '" + SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_MODEL, responseNode.get("id").textValue()) + "',"
                              + "deploymentUrl: '" + SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_DEPLOYMENT, deploymentId) + "',"
                              + "createTime: " + new TextNode(getISODateStringWithTZ(createTime.getTime())) + ","
                              + "lastUpdateTime: " + new TextNode(getISODateStringWithTZ(createTime.getTime()))
                              + "}");
  
              model = repositoryService.createModelQuery().modelId(responseNode.get("id").textValue()).singleResult();
              assertThat(model).isNotNull();
              assertThat(model.getCategory()).isEqualTo("Model category");
              assertThat(model.getName()).isEqualTo("Model name");
              assertThat(model.getKey()).isEqualTo("Model key");
              assertThat(model.getDeploymentId()).isEqualTo(deploymentId);
              assertThat(model.getMetaInfo()).isEqualTo("Model metainfo");
              assertThat(model.getTenantId()).isEqualTo("myTenant");
              assertThat(model.getVersion().intValue()).isEqualTo(2);
  
          } finally {
              if (model != null) {
                  try {
                      repositoryService.deleteModel(model.getId());
                  } catch (Throwable ignore) {
                  }
              }
          }
      }
test_case.class_method_signature: ModelCollectionResourceTest.testCreateModel()
test_case.full_signature: @Test @Deployment(resources = { "org/flowable/rest/service/api/repository/oneTaskProcess.bpmn20.xml" }) public void testCreateModel()
test_case.identifier: testCreateModel
test_case.invocations: getInstance set setCurrentTime getClock getTime createObjectNode put put put put put put put createRelativeResourceUrl setEntity toString executeRequest readTree getContent getEntity closeResponse isNotNull assertThat isEqualTo when assertThatJson createRelativeResourceUrl textValue get createRelativeResourceUrl getISODateStringWithTZ getTime getISODateStringWithTZ getTime singleResult modelId createModelQuery textValue get isNotNull assertThat isEqualTo assertThat getCategory isEqualTo assertThat getName isEqualTo assertThat getKey isEqualTo assertThat getDeploymentId isEqualTo assertThat getMetaInfo isEqualTo assertThat getTenantId isEqualTo assertThat intValue getVersion deleteModel getId
test_case.modifiers: @Test @Deployment(resources = { "org/flowable/rest/service/api/repository/oneTaskProcess.bpmn20.xml" }) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCreateModel()
focal_class.declarator: allowedSortProperties = new HashMap<>()
focal_class.modifier: private static
focal_class.original_string: private static Map<String, QueryProperty> allowedSortProperties = new HashMap<>();
focal_class.type: Map<String, QueryProperty>
focal_class.var_name: allowedSortProperties
focal_class.file: modules/flowable-rest/src/main/java/org/flowable/rest/service/api/repository/ModelCollectionResource.java
focal_class.identifier: ModelCollectionResource
focal_class.class_method_signature: ModelCollectionResource.getModels(@ApiParam(hidden = true) @RequestParam Map<String, String> allRequestParams, HttpServletRequest request)
focal_class.full_signature: @ApiOperation(value = "List models", nickname= "listModels", tags = { "Models" }) @ApiImplicitParams({ @ApiImplicitParam(name = "id", dataType = "string", value = "Only return models with the given version.", paramType = "query"), @ApiImplicitParam(name = "category", dataType = "string", value = "Only return models with the given category.", paramType = "query"), @ApiImplicitParam(name = "categoryLike", dataType = "string", value = "Only return models with a category like the given name.", paramType = "query"), @ApiImplicitParam(name = "categoryNotEquals", dataType = "string", value = "Only return models which do not have the given category.", paramType = "query"), @ApiImplicitParam(name = "name", dataType = "string", value = "Only return models with the given name.", paramType = "query"), @ApiImplicitParam(name = "nameLike", dataType = "string", value = "Only return models with a name like the given name.", paramType = "query"), @ApiImplicitParam(name = "key", dataType = "string", value = "Only return models with the given key.", paramType = "query"), @ApiImplicitParam(name = "deploymentId", dataType = "string", value = "Only return models with the given category.", paramType = "query"), @ApiImplicitParam(name = "version", dataType = "integer", value = "Only return models with the given version.", paramType = "query"), @ApiImplicitParam(name = "latestVersion", dataType = "boolean", value = "If true, only return models which are the latest version. Best used in combination with key. If false is passed in as value, this is ignored and all versions are returned.", paramType = "query"), @ApiImplicitParam(name = "deployed", dataType = "boolean", value = "If true, only deployed models are returned. If false, only undeployed models are returned (deploymentId is null).", paramType = "query"), @ApiImplicitParam(name = "tenantId", dataType = "string", value = "Only return models with the given tenantId.", paramType = "query"), @ApiImplicitParam(name = "tenantIdLike", dataType = "string", value = "Only return models with a tenantId like the given value.", paramType = "query"), @ApiImplicitParam(name = "withoutTenantId", dataType = "boolean", value = "If true, only returns models without a tenantId set. If false, the withoutTenantId parameter is ignored.", paramType = "query"), @ApiImplicitParam(name = "sort", dataType = "string", value = "Property to sort on, to be used together with the order.", allowableValues = "id,category,createTime,key,lastUpdateTime,name,version,tenantId", paramType = "query"), }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates request was successful and the models are returned"), @ApiResponse(code = 400, message = "Indicates a parameter was passed in the wrong format. The status-message contains additional information.") }) @GetMapping(value = "/repository/models", produces = "application/json") public DataResponse<ModelResponse> getModels(@ApiParam(hidden = true) @RequestParam Map<String, String> allRequestParams, HttpServletRequest request)
focal_class.identifier: getModels
focal_class.modifiers: @ApiOperation(value = "List models", nickname= "listModels", tags = { "Models" }) @ApiImplicitParams({ @ApiImplicitParam(name = "id", dataType = "string", value = "Only return models with the given version.", paramType = "query"), @ApiImplicitParam(name = "category", dataType = "string", value = "Only return models with the given category.", paramType = "query"), @ApiImplicitParam(name = "categoryLike", dataType = "string", value = "Only return models with a category like the given name.", paramType = "query"), @ApiImplicitParam(name = "categoryNotEquals", dataType = "string", value = "Only return models which do not have the given category.", paramType = "query"), @ApiImplicitParam(name = "name", dataType = "string", value = "Only return models with the given name.", paramType = "query"), @ApiImplicitParam(name = "nameLike", dataType = "string", value = "Only return models with a name like the given name.", paramType = "query"), @ApiImplicitParam(name = "key", dataType = "string", value = "Only return models with the given key.", paramType = "query"), @ApiImplicitParam(name = "deploymentId", dataType = "string", value = "Only return models with the given category.", paramType = "query"), @ApiImplicitParam(name = "version", dataType = "integer", value = "Only return models with the given version.", paramType = "query"), @ApiImplicitParam(name = "latestVersion", dataType = "boolean", value = "If true, only return models which are the latest version. Best used in combination with key. If false is passed in as value, this is ignored and all versions are returned.", paramType = "query"), @ApiImplicitParam(name = "deployed", dataType = "boolean", value = "If true, only deployed models are returned. If false, only undeployed models are returned (deploymentId is null).", paramType = "query"), @ApiImplicitParam(name = "tenantId", dataType = "string", value = "Only return models with the given tenantId.", paramType = "query"), @ApiImplicitParam(name = "tenantIdLike", dataType = "string", value = "Only return models with a tenantId like the given value.", paramType = "query"), @ApiImplicitParam(name = "withoutTenantId", dataType = "boolean", value = "If true, only returns models without a tenantId set. If false, the withoutTenantId parameter is ignored.", paramType = "query"), @ApiImplicitParam(name = "sort", dataType = "string", value = "Property to sort on, to be used together with the order.", allowableValues = "id,category,createTime,key,lastUpdateTime,name,version,tenantId", paramType = "query"), }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates request was successful and the models are returned"), @ApiResponse(code = 400, message = "Indicates a parameter was passed in the wrong format. The status-message contains additional information.") }) @GetMapping(value = "/repository/models", produces = "application/json") public
focal_class.parameters: (@ApiParam(hidden = true) @RequestParam Map<String, String> allRequestParams, HttpServletRequest request)
focal_class.return: DataResponse<ModelResponse>
focal_class.signature: DataResponse<ModelResponse> getModels(@ApiParam(hidden = true) @RequestParam Map<String, String> allRequestParams, HttpServletRequest request)
focal_class.class_method_signature: ModelCollectionResource.createModel(@RequestBody ModelRequest modelRequest, HttpServletRequest request, HttpServletResponse response)
focal_class.full_signature: @ApiOperation(value = "Create a model", tags = { "Models" }, notes = "All request values are optional. For example, you can only include the name attribute in the request body JSON-object, only setting the name of the model, leaving all other fields null.") @ApiResponses(value = { @ApiResponse(code = 201, message = "Indicates the model was created.") }) @PostMapping(value = "/repository/models", produces = "application/json") public ModelResponse createModel(@RequestBody ModelRequest modelRequest, HttpServletRequest request, HttpServletResponse response)
focal_class.identifier: createModel
focal_class.modifiers: @ApiOperation(value = "Create a model", tags = { "Models" }, notes = "All request values are optional. For example, you can only include the name attribute in the request body JSON-object, only setting the name of the model, leaving all other fields null.") @ApiResponses(value = { @ApiResponse(code = 201, message = "Indicates the model was created.") }) @PostMapping(value = "/repository/models", produces = "application/json") public
focal_class.parameters: (@RequestBody ModelRequest modelRequest, HttpServletRequest request, HttpServletResponse response)
focal_class.return: ModelResponse
focal_class.signature: ModelResponse createModel(@RequestBody ModelRequest modelRequest, HttpServletRequest request, HttpServletResponse response)
focal_class.superclass: extends BaseModelResource
focal_method.body: @ApiOperation(value = "Create a model", tags = {
              "Models" }, notes = "All request values are optional. For example, you can only include the name attribute in the request body JSON-object, only setting the name of the model, leaving all other fields null.")
      @ApiResponses(value = {
              @ApiResponse(code = 201, message = "Indicates the model was created.")
      })
      @PostMapping(value = "/repository/models", produces = "application/json")
      public ModelResponse createModel(@RequestBody ModelRequest modelRequest, HttpServletRequest request, HttpServletResponse response) {
          Model model = repositoryService.newModel();
          model.setCategory(modelRequest.getCategory());
          model.setDeploymentId(modelRequest.getDeploymentId());
          model.setKey(modelRequest.getKey());
          model.setMetaInfo(modelRequest.getMetaInfo());
          model.setName(modelRequest.getName());
          model.setVersion(modelRequest.getVersion());
          model.setTenantId(modelRequest.getTenantId());
          
          if (restApiInterceptor != null) {
              restApiInterceptor.createModel(model, modelRequest);
          }
  
          repositoryService.saveModel(model);
          response.setStatus(HttpStatus.CREATED.value());
          return restResponseFactory.createModelResponse(model);
      }
focal_method.class_method_signature: ModelCollectionResource.createModel(@RequestBody ModelRequest modelRequest, HttpServletRequest request, HttpServletResponse response)
focal_method.full_signature: @ApiOperation(value = "Create a model", tags = { "Models" }, notes = "All request values are optional. For example, you can only include the name attribute in the request body JSON-object, only setting the name of the model, leaving all other fields null.") @ApiResponses(value = { @ApiResponse(code = 201, message = "Indicates the model was created.") }) @PostMapping(value = "/repository/models", produces = "application/json") public ModelResponse createModel(@RequestBody ModelRequest modelRequest, HttpServletRequest request, HttpServletResponse response)
focal_method.identifier: createModel
focal_method.invocations: newModel setCategory getCategory setDeploymentId getDeploymentId setKey getKey setMetaInfo getMetaInfo setName getName setVersion getVersion setTenantId getTenantId createModel saveModel setStatus value createModelResponse
focal_method.modifiers: @ApiOperation(value = "Create a model", tags = { "Models" }, notes = "All request values are optional. For example, you can only include the name attribute in the request body JSON-object, only setting the name of the model, leaving all other fields null.") @ApiResponses(value = { @ApiResponse(code = 201, message = "Indicates the model was created.") }) @PostMapping(value = "/repository/models", produces = "application/json") public
focal_method.parameters: (@RequestBody ModelRequest modelRequest, HttpServletRequest request, HttpServletResponse response)
focal_method.return: ModelResponse
focal_method.signature: ModelResponse createModel(@RequestBody ModelRequest modelRequest, HttpServletRequest request, HttpServletResponse response)