@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) {
        Model model = getModelFromRequest(modelId);

        return restResponseFactory.createModelResponse(model);
    }
@Test
    @Deployment(resources = { "org/flowable/rest/service/api/repository/oneTaskProcess.bpmn20.xml" })
    public void testGetModel() 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);
            model.setTenantId("myTenant");
            repositoryService.saveModel(model);

            repositoryService.addModelEditorSource(model.getId(), "This is the editor source".getBytes());
            repositoryService.addModelEditorSourceExtra(model.getId(), "This is the extra editor source".getBytes());

            HttpGet httpGet = new HttpGet(SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_MODEL, model.getId()));
            CloseableHttpResponse response = executeRequest(httpGet, HttpStatus.SC_OK);

            JsonNode responseNode = objectMapper.readTree(response.getEntity().getContent());
            closeResponse(response);
            assertThat(responseNode).isNotNull();
            assertThatJson(responseNode)
                    .isEqualTo("{"
                            + "name: 'Model name',"
                            + "key: 'Model key',"
                            + "category: 'Model category',"
                            + "version: 2,"
                            + "metaInfo: 'Model metainfo',"
                            + "deploymentId: '" + deploymentId + "',"
                            + "id: '" + model.getId() + "',"
                            + "tenantId: 'myTenant',"
                            + "url: '" + SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_MODEL, model.getId()) + "',"
                            + "deploymentUrl: '" + SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_DEPLOYMENT, deploymentId) + "',"
                            + "sourceUrl: '" + SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_MODEL_SOURCE, model.getId()) + "',"
                            + "sourceExtraUrl: '" + SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_MODEL_SOURCE_EXTRA, model.getId())
                            + "',"
                            + "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
            }
        }
    }