@ApiOperation(value = "Delete a model", tags = { "Models" }, code = 204)
    @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}")
    @ResponseStatus(HttpStatus.NO_CONTENT)
    public void deleteModel(@ApiParam(name = "modelId") @PathVariable String modelId) {
        Model model = getModelFromRequest(modelId);
        repositoryService.deleteModel(model.getId());
    }
@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
            }
        }
    }