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 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
              }
          }
      }
test_case.class_method_signature: ModelResourceTest.testGetModel()
test_case.full_signature: @Test @Deployment(resources = { "org/flowable/rest/service/api/repository/oneTaskProcess.bpmn20.xml" }) public void testGetModel()
test_case.identifier: testGetModel
test_case.invocations: getInstance set setCurrentTime getClock getTime newModel setCategory setKey setMetaInfo setName setVersion setDeploymentId setTenantId saveModel addModelEditorSource getId getBytes addModelEditorSourceExtra getId getBytes createRelativeResourceUrl getId executeRequest readTree getContent getEntity closeResponse isNotNull assertThat isEqualTo assertThatJson getId createRelativeResourceUrl getId createRelativeResourceUrl createRelativeResourceUrl getId createRelativeResourceUrl getId 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 testGetModel()
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 = "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) {
          Model model = getModelFromRequest(modelId);
  
          return restResponseFactory.createModelResponse(model);
      }
focal_method.class_method_signature: ModelResource.getModel(@ApiParam(name = "modelId") @PathVariable String modelId, HttpServletRequest request)
focal_method.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_method.identifier: getModel
focal_method.invocations: getModelFromRequest createModelResponse
focal_method.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_method.parameters: (@ApiParam(name = "modelId") @PathVariable String modelId, HttpServletRequest request)
focal_method.return: ModelResponse
focal_method.signature: ModelResponse getModel(@ApiParam(name = "modelId") @PathVariable String modelId, HttpServletRequest request)