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
      public void testDeleteModel() 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);
              repositoryService.saveModel(model);
  
              HttpDelete httpDelete = new HttpDelete(SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_MODEL, model.getId()));
              closeResponse(executeRequest(httpDelete, HttpStatus.SC_NO_CONTENT));
  
              // Check if the model is really gone
              assertThat(repositoryService.createModelQuery().modelId(model.getId()).singleResult()).isNull();
  
              model = null;
          } finally {
              if (model != null) {
                  try {
                      repositoryService.deleteModel(model.getId());
                  } catch (Throwable ignore) {
                      // Ignore, model might not be created
                  }
              }
          }
      }
test_case.class_method_signature: ModelResourceTest.testDeleteModel()
test_case.full_signature: @Test public void testDeleteModel()
test_case.identifier: testDeleteModel
test_case.invocations: getInstance set setCurrentTime getClock getTime newModel setCategory setKey setMetaInfo setName setVersion saveModel createRelativeResourceUrl getId closeResponse executeRequest isNull assertThat singleResult modelId createModelQuery getId deleteModel getId
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testDeleteModel()
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)