test_class.file: modules/flowable-rest/src/test/java/org/flowable/rest/service/api/repository/ModelResourceTest.java
test_class.identifier: ModelResourceTest
test_class.superclass: extends BaseSpringRestTestCase
test_case.body: @Test
      @Deployment(resources = { "org/flowable/rest/service/api/repository/oneTaskProcess.bpmn20.xml" })
      public void testUpdateModelNoFields() throws Exception {
  
          Model model = null;
          try {
              Calendar now = Calendar.getInstance();
              now.set(Calendar.MILLISECOND, 0);
              processEngineConfiguration.getClock().setCurrentTime(now.getTime());
  
              model = repositoryService.newModel();
              model.setCategory("Model category");
              model.setKey("Model key");
              model.setMetaInfo("Model metainfo");
              model.setName("Model name");
              model.setVersion(2);
              model.setDeploymentId(deploymentId);
              repositoryService.saveModel(model);
  
              // Use empty request-node, nothing should be changed after update
              ObjectNode requestNode = objectMapper.createObjectNode();
  
              HttpPut httpPut = new HttpPut(SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_MODEL, model.getId()));
              httpPut.setEntity(new StringEntity(requestNode.toString()));
              CloseableHttpResponse response = executeRequest(httpPut, HttpStatus.SC_OK);
              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 + "',"
                              + "id: '" + model.getId() + "',"
                              + "url: '" + SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_MODEL, model.getId()) + "',"
                              + "deploymentUrl: '" + SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_DEPLOYMENT, deploymentId) + "',"
                              + "createTime: " + new TextNode(getISODateStringWithTZ(now.getTime())) + ","
                              + "lastUpdateTime: " + new TextNode(getISODateStringWithTZ(now.getTime()))
                              + "}");
  
          } finally {
              try {
                  repositoryService.deleteModel(model.getId());
              } catch (Throwable ignore) {
                  // Ignore, model might not be created
              }
          }
      }
test_case.class_method_signature: ModelResourceTest.testUpdateModelNoFields()
test_case.full_signature: @Test @Deployment(resources = { "org/flowable/rest/service/api/repository/oneTaskProcess.bpmn20.xml" }) public void testUpdateModelNoFields()
test_case.identifier: testUpdateModelNoFields
test_case.invocations: getInstance set setCurrentTime getClock getTime newModel setCategory setKey setMetaInfo setName setVersion setDeploymentId saveModel createObjectNode createRelativeResourceUrl getId setEntity toString executeRequest readTree getContent getEntity closeResponse isNotNull assertThat isEqualTo when assertThatJson getId createRelativeResourceUrl getId createRelativeResourceUrl getISODateStringWithTZ getTime getISODateStringWithTZ getTime 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 testUpdateModelNoFields()
focal_class.file: modules/flowable-rest/src/main/java/org/flowable/rest/service/api/repository/ModelResource.java
focal_class.identifier: ModelResource
focal_class.class_method_signature: ModelResource.getModel(@ApiParam(name = "modelId") @PathVariable String modelId, HttpServletRequest request)
focal_class.full_signature: @ApiOperation(value = "Get a model", tags = { "Models" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the model was found and returned."), @ApiResponse(code = 404, message = "Indicates the requested model was not found.") }) @GetMapping(value = "/repository/models/{modelId}", produces = "application/json") public ModelResponse getModel(@ApiParam(name = "modelId") @PathVariable String modelId, HttpServletRequest request)
focal_class.identifier: getModel
focal_class.modifiers: @ApiOperation(value = "Get a model", tags = { "Models" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the model was found and returned."), @ApiResponse(code = 404, message = "Indicates the requested model was not found.") }) @GetMapping(value = "/repository/models/{modelId}", produces = "application/json") public
focal_class.parameters: (@ApiParam(name = "modelId") @PathVariable String modelId, HttpServletRequest request)
focal_class.return: ModelResponse
focal_class.signature: ModelResponse getModel(@ApiParam(name = "modelId") @PathVariable String modelId, HttpServletRequest request)
focal_class.class_method_signature: ModelResource.updateModel(@ApiParam(name = "modelId") @PathVariable String modelId, @RequestBody ModelRequest modelRequest, HttpServletRequest request)
focal_class.full_signature: @ApiOperation(value = "Update 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 updating the name of the model, leaving all other fields unaffected. " + "When an attribute is explicitly included and is set to null, the model-value will be updated to null. ") @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the model was found and updated."), @ApiResponse(code = 404, message = "Indicates the requested model was not found.") }) @PutMapping(value = "/repository/models/{modelId}", produces = "application/json") public ModelResponse updateModel(@ApiParam(name = "modelId") @PathVariable String modelId, @RequestBody ModelRequest modelRequest, HttpServletRequest request)
focal_class.identifier: updateModel
focal_class.modifiers: @ApiOperation(value = "Update 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 updating the name of the model, leaving all other fields unaffected. " + "When an attribute is explicitly included and is set to null, the model-value will be updated to null. ") @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the model was found and updated."), @ApiResponse(code = 404, message = "Indicates the requested model was not found.") }) @PutMapping(value = "/repository/models/{modelId}", produces = "application/json") public
focal_class.parameters: (@ApiParam(name = "modelId") @PathVariable String modelId, @RequestBody ModelRequest modelRequest, HttpServletRequest request)
focal_class.return: ModelResponse
focal_class.signature: ModelResponse updateModel(@ApiParam(name = "modelId") @PathVariable String modelId, @RequestBody ModelRequest modelRequest, HttpServletRequest request)
focal_class.class_method_signature: ModelResource.deleteModel(@ApiParam(name = "modelId") @PathVariable String modelId, HttpServletResponse response)
focal_class.full_signature: @ApiOperation(value = "Delete a model", tags = { "Models" }) @ApiResponses(value = { @ApiResponse(code = 204, message = "Indicates the model was found and has been deleted. Response-body is intentionally empty."), @ApiResponse(code = 404, message = "Indicates the requested model was not found.") }) @DeleteMapping("/repository/models/{modelId}") public void deleteModel(@ApiParam(name = "modelId") @PathVariable String modelId, HttpServletResponse response)
focal_class.identifier: deleteModel
focal_class.modifiers: @ApiOperation(value = "Delete a model", tags = { "Models" }) @ApiResponses(value = { @ApiResponse(code = 204, message = "Indicates the model was found and has been deleted. Response-body is intentionally empty."), @ApiResponse(code = 404, message = "Indicates the requested model was not found.") }) @DeleteMapping("/repository/models/{modelId}") public
focal_class.parameters: (@ApiParam(name = "modelId") @PathVariable String modelId, HttpServletResponse response)
focal_class.return: void
focal_class.signature: void deleteModel(@ApiParam(name = "modelId") @PathVariable String modelId, HttpServletResponse response)
focal_class.superclass: extends BaseModelResource
focal_method.body: @ApiOperation(value = "Delete a model", tags = { "Models" })
      @ApiResponses(value = {
              @ApiResponse(code = 204, message = "Indicates the model was found and has been deleted. Response-body is intentionally empty."),
              @ApiResponse(code = 404, message = "Indicates the requested model was not found.")
      })
      @DeleteMapping("/repository/models/{modelId}")
      public void deleteModel(@ApiParam(name = "modelId") @PathVariable String modelId, HttpServletResponse response) {
          Model model = getModelFromRequest(modelId);
          repositoryService.deleteModel(model.getId());
          response.setStatus(HttpStatus.NO_CONTENT.value());
      }
focal_method.class_method_signature: ModelResource.deleteModel(@ApiParam(name = "modelId") @PathVariable String modelId, HttpServletResponse response)
focal_method.full_signature: @ApiOperation(value = "Delete a model", tags = { "Models" }) @ApiResponses(value = { @ApiResponse(code = 204, message = "Indicates the model was found and has been deleted. Response-body is intentionally empty."), @ApiResponse(code = 404, message = "Indicates the requested model was not found.") }) @DeleteMapping("/repository/models/{modelId}") public void deleteModel(@ApiParam(name = "modelId") @PathVariable String modelId, HttpServletResponse response)
focal_method.identifier: deleteModel
focal_method.invocations: getModelFromRequest deleteModel getId setStatus value
focal_method.modifiers: @ApiOperation(value = "Delete a model", tags = { "Models" }) @ApiResponses(value = { @ApiResponse(code = 204, message = "Indicates the model was found and has been deleted. Response-body is intentionally empty."), @ApiResponse(code = 404, message = "Indicates the requested model was not found.") }) @DeleteMapping("/repository/models/{modelId}") public
focal_method.parameters: (@ApiParam(name = "modelId") @PathVariable String modelId, HttpServletResponse response)
focal_method.return: void
focal_method.signature: void deleteModel(@ApiParam(name = "modelId") @PathVariable String modelId, HttpServletResponse response)