test_class.declarator: mapper = new ObjectMapper()
test_class.modifier: private
test_class.original_string: private ObjectMapper mapper = new ObjectMapper();
test_class.type: ObjectMapper
test_class.var_name: mapper
test_class.declarator: factory = JsonNodeFactory.instance
test_class.modifier: private
test_class.original_string: private JsonNodeFactory factory = JsonNodeFactory.instance;
test_class.type: JsonNodeFactory
test_class.var_name: factory
test_class.declarator: tableMetadataManager
test_class.modifier: private
test_class.original_string: private TableMetadataManager tableMetadataManager;
test_class.type: TableMetadataManager
test_class.var_name: tableMetadataManager
test_class.declarator: elasticsearchServer
test_class.modifier: private
test_class.original_string: private MockElasticsearchServer elasticsearchServer;
test_class.type: MockElasticsearchServer
test_class.var_name: elasticsearchServer
test_class.declarator: hazelcastInstance
test_class.modifier: private
test_class.original_string: private HazelcastInstance hazelcastInstance;
test_class.type: HazelcastInstance
test_class.var_name: hazelcastInstance
test_class.declarator: queryStore
test_class.modifier: private
test_class.original_string: private QueryStore queryStore;
test_class.type: QueryStore
test_class.var_name: queryStore
test_class.file: real-time/foxtrot/foxtrot-server/src/test/java/com/flipkart/foxtrot/server/resources/DocumentResourceTest.java
test_class.identifier: DocumentResourceTest
test_class.superclass: extends ResourceTest
test_case.body: @Test
      public void testGetDocument() throws Exception {
          String id = UUID.randomUUID().toString();
          Document document = new Document(id, System.currentTimeMillis(), factory.objectNode().put("D", "data"));
          queryStore.save(TestUtils.TEST_TABLE_NAME, document);
  
          Document response = client().resource(String.format("/v1/document/%s/%s", TestUtils.TEST_TABLE_NAME, id))
                  .get(Document.class);
          compare(document, response);
      }
test_case.class_method_signature: DocumentResourceTest.testGetDocument()
test_case.full_signature: @Test public void testGetDocument()
test_case.identifier: testGetDocument
test_case.invocations: toString randomUUID currentTimeMillis put objectNode save get resource client format compare
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetDocument()
focal_class.declarator: logger = LoggerFactory.getLogger(DocumentResource.class.getSimpleName())
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(DocumentResource.class.getSimpleName());
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: queryStore
focal_class.modifier: private final
focal_class.original_string: private final QueryStore queryStore;
focal_class.type: QueryStore
focal_class.var_name: queryStore
focal_class.file: real-time/foxtrot/foxtrot-server/src/main/java/com/flipkart/foxtrot/server/resources/DocumentResource.java
focal_class.identifier: DocumentResource
focal_class.class_method_signature: DocumentResource.DocumentResource(QueryStore queryStore)
focal_class.full_signature: public  DocumentResource(QueryStore queryStore)
focal_class.identifier: DocumentResource
focal_class.modifiers: public
focal_class.parameters: (QueryStore queryStore)
focal_class.signature:  DocumentResource(QueryStore queryStore)
focal_class.class_method_signature: DocumentResource.saveDocument(@PathParam("table") final String table, @Valid final Document document)
focal_class.full_signature: @POST public Response saveDocument(@PathParam("table") final String table, @Valid final Document document)
focal_class.identifier: saveDocument
focal_class.modifiers: @POST public
focal_class.parameters: (@PathParam("table") final String table, @Valid final Document document)
focal_class.return: Response
focal_class.signature: Response saveDocument(@PathParam("table") final String table, @Valid final Document document)
focal_class.class_method_signature: DocumentResource.saveDocuments(@PathParam("table") final String table, @Valid final List<Document> document)
focal_class.full_signature: @POST @Path("/bulk") public Response saveDocuments(@PathParam("table") final String table, @Valid final List<Document> document)
focal_class.identifier: saveDocuments
focal_class.modifiers: @POST @Path("/bulk") public
focal_class.parameters: (@PathParam("table") final String table, @Valid final List<Document> document)
focal_class.return: Response
focal_class.signature: Response saveDocuments(@PathParam("table") final String table, @Valid final List<Document> document)
focal_class.class_method_signature: DocumentResource.getDocument(@PathParam("table") final String table, @PathParam("id") @NotNull final String id)
focal_class.full_signature: @GET @Path("/{id}") public Response getDocument(@PathParam("table") final String table, @PathParam("id") @NotNull final String id)
focal_class.identifier: getDocument
focal_class.modifiers: @GET @Path("/{id}") public
focal_class.parameters: (@PathParam("table") final String table, @PathParam("id") @NotNull final String id)
focal_class.return: Response
focal_class.signature: Response getDocument(@PathParam("table") final String table, @PathParam("id") @NotNull final String id)
focal_class.class_method_signature: DocumentResource.getDocuments(@PathParam("table") final String table, @QueryParam("id") @NotNull final List<String> ids)
focal_class.full_signature: @GET public Response getDocuments(@PathParam("table") final String table, @QueryParam("id") @NotNull final List<String> ids)
focal_class.identifier: getDocuments
focal_class.modifiers: @GET public
focal_class.parameters: (@PathParam("table") final String table, @QueryParam("id") @NotNull final List<String> ids)
focal_class.return: Response
focal_class.signature: Response getDocuments(@PathParam("table") final String table, @QueryParam("id") @NotNull final List<String> ids)
focal_method.body: @GET
      @Path("/{id}")
      public Response getDocument(@PathParam("table") final String table, @PathParam("id") @NotNull final String id) {
          try {
              return Response.ok(queryStore.get(table, id)).build();
          } catch (QueryStoreException ex) {
              logger.error("Get error : ", ex);
              switch (ex.getErrorCode()) {
                  case DOCUMENT_NOT_FOUND:
                      return Response.status(Response.Status.NOT_FOUND)
                              .entity(Collections.singletonMap("error", ex.getErrorCode()))
                              .build();
                  case DOCUMENT_GET_ERROR:
                  default:
                      return Response.serverError()
                              .entity(Collections.singletonMap("error", ex.getErrorCode()))
                              .build();
  
              }
          }
      }
focal_method.class_method_signature: DocumentResource.getDocument(@PathParam("table") final String table, @PathParam("id") @NotNull final String id)
focal_method.full_signature: @GET @Path("/{id}") public Response getDocument(@PathParam("table") final String table, @PathParam("id") @NotNull final String id)
focal_method.identifier: getDocument
focal_method.invocations: build ok get error getErrorCode build entity status singletonMap getErrorCode build entity serverError singletonMap getErrorCode
focal_method.modifiers: @GET @Path("/{id}") public
focal_method.parameters: (@PathParam("table") final String table, @PathParam("id") @NotNull final String id)
focal_method.return: Response
focal_method.signature: Response getDocument(@PathParam("table") final String table, @PathParam("id") @NotNull final String id)