test_class.file: modules/flowable-rest/src/test/java/org/flowable/rest/service/api/management/TableResourceTest.java
test_class.identifier: TableResourceTest
test_class.superclass: extends BaseSpringRestTestCase
test_case.body: @Test
      public void testGetTable() throws Exception {
          Map<String, Long> tableCounts = managementService.getTableCount();
  
          String tableNameToGet = tableCounts.keySet().iterator().next();
  
          CloseableHttpResponse response = executeRequest(new HttpGet(SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_TABLE, tableNameToGet)),
                  HttpStatus.SC_OK);
  
          // Check table
          JsonNode responseNode = objectMapper.readTree(response.getEntity().getContent());
          closeResponse(response);
          assertThat(responseNode).isNotNull();
          assertThatJson(responseNode)
                  .isEqualTo("{"
                          + "name: '" + tableNameToGet + "',"
                          + "count: " + tableCounts.get(tableNameToGet) + ","
                          + "url: '" + SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_TABLE, tableNameToGet) + "'"
                          + "}");
      }
test_case.class_method_signature: TableResourceTest.testGetTable()
test_case.full_signature: @Test public void testGetTable()
test_case.identifier: testGetTable
test_case.invocations: getTableCount next iterator keySet executeRequest createRelativeResourceUrl readTree getContent getEntity closeResponse isNotNull assertThat isEqualTo assertThatJson get createRelativeResourceUrl
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetTable()
focal_class.declarator: restResponseFactory
focal_class.modifier: @Autowired
      protected
focal_class.original_string: @Autowired
      protected RestResponseFactory restResponseFactory;
focal_class.type: RestResponseFactory
focal_class.var_name: restResponseFactory
focal_class.declarator: managementService
focal_class.modifier: @Autowired
      protected
focal_class.original_string: @Autowired
      protected ManagementService managementService;
focal_class.type: ManagementService
focal_class.var_name: managementService
focal_class.declarator: restApiInterceptor
focal_class.modifier: @Autowired(required=false)
      protected
focal_class.original_string: @Autowired(required=false)
      protected BpmnRestApiInterceptor restApiInterceptor;
focal_class.type: BpmnRestApiInterceptor
focal_class.var_name: restApiInterceptor
focal_class.file: modules/flowable-rest/src/main/java/org/flowable/rest/service/api/management/TableResource.java
focal_class.identifier: TableResource
focal_class.class_method_signature: TableResource.getTable(@ApiParam(name = "tableName") @PathVariable String tableName, HttpServletRequest request)
focal_class.full_signature: @ApiOperation(value = "Get a single table", tags = { "Database tables" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the table exists and the table count is returned."), @ApiResponse(code = 404, message = "Indicates the requested table does not exist.") }) @GetMapping(value = "/management/tables/{tableName}", produces = "application/json") public TableResponse getTable(@ApiParam(name = "tableName") @PathVariable String tableName, HttpServletRequest request)
focal_class.identifier: getTable
focal_class.modifiers: @ApiOperation(value = "Get a single table", tags = { "Database tables" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the table exists and the table count is returned."), @ApiResponse(code = 404, message = "Indicates the requested table does not exist.") }) @GetMapping(value = "/management/tables/{tableName}", produces = "application/json") public
focal_class.parameters: (@ApiParam(name = "tableName") @PathVariable String tableName, HttpServletRequest request)
focal_class.return: TableResponse
focal_class.signature: TableResponse getTable(@ApiParam(name = "tableName") @PathVariable String tableName, HttpServletRequest request)
focal_method.body: @ApiOperation(value = "Get a single table", tags = { "Database tables" })
      @ApiResponses(value = {
              @ApiResponse(code = 200, message = "Indicates the table exists and the table count is returned."),
              @ApiResponse(code = 404, message = "Indicates the requested table does not exist.")
      })
      @GetMapping(value = "/management/tables/{tableName}", produces = "application/json")
      public TableResponse getTable(@ApiParam(name = "tableName") @PathVariable String tableName, HttpServletRequest request) {
          if (restApiInterceptor != null) {
              restApiInterceptor.accessTableInfo();
          }
          
          Map<String, Long> tableCounts = managementService.getTableCount();
  
          TableResponse response = null;
          for (Entry<String, Long> entry : tableCounts.entrySet()) {
              if (entry.getKey().equals(tableName)) {
                  response = restResponseFactory.createTableResponse(entry.getKey(), entry.getValue());
                  break;
              }
          }
  
          if (response == null) {
              throw new FlowableObjectNotFoundException("Could not find a table with name '" + tableName + "'.", String.class);
          }
          return response;
      }
focal_method.class_method_signature: TableResource.getTable(@ApiParam(name = "tableName") @PathVariable String tableName, HttpServletRequest request)
focal_method.full_signature: @ApiOperation(value = "Get a single table", tags = { "Database tables" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the table exists and the table count is returned."), @ApiResponse(code = 404, message = "Indicates the requested table does not exist.") }) @GetMapping(value = "/management/tables/{tableName}", produces = "application/json") public TableResponse getTable(@ApiParam(name = "tableName") @PathVariable String tableName, HttpServletRequest request)
focal_method.identifier: getTable
focal_method.invocations: accessTableInfo getTableCount entrySet equals getKey createTableResponse getKey getValue
focal_method.modifiers: @ApiOperation(value = "Get a single table", tags = { "Database tables" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Indicates the table exists and the table count is returned."), @ApiResponse(code = 404, message = "Indicates the requested table does not exist.") }) @GetMapping(value = "/management/tables/{tableName}", produces = "application/json") public
focal_method.parameters: (@ApiParam(name = "tableName") @PathVariable String tableName, HttpServletRequest request)
focal_method.return: TableResponse
focal_method.signature: TableResponse getTable(@ApiParam(name = "tableName") @PathVariable String tableName, HttpServletRequest request)