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 testSaveDocuments() throws Exception {
          List<Document> documents = new ArrayList<Document>();
          String id1 = UUID.randomUUID().toString();
          Document document1 = new Document(id1, System.currentTimeMillis(), factory.objectNode().put("D", "data"));
          String id2 = UUID.randomUUID().toString();
          Document document2 = new Document(id2, System.currentTimeMillis(), factory.objectNode().put("D", "data"));
          documents.add(document1);
          documents.add(document2);
          client().resource(String.format("/v1/document/%s/bulk", TestUtils.TEST_TABLE_NAME)).type(MediaType.APPLICATION_JSON_TYPE).post(documents);
  
          compare(document1, queryStore.get(TestUtils.TEST_TABLE_NAME, id1));
          compare(document2, queryStore.get(TestUtils.TEST_TABLE_NAME, id2));
      }
test_case.class_method_signature: DocumentResourceTest.testSaveDocuments()
test_case.full_signature: @Test public void testSaveDocuments()
test_case.identifier: testSaveDocuments
test_case.invocations: toString randomUUID currentTimeMillis put objectNode toString randomUUID currentTimeMillis put objectNode add add post type resource client format compare get compare get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSaveDocuments()
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: @POST
      @Path("/bulk")
      public Response saveDocuments(@PathParam("table") final String table, @Valid final List<Document> document) {
          try {
              queryStore.save(table, document);
          } catch (QueryStoreException ex) {
              logger.error("Save error: ", ex);
              switch (ex.getErrorCode()) {
                  case NO_SUCH_TABLE:
                  case INVALID_REQUEST:
                      return Response.status(Response.Status.BAD_REQUEST)
                              .entity(Collections.singletonMap("error", ex.getErrorCode()))
                              .build();
                  case DOCUMENT_SAVE_ERROR:
                  default:
                      return Response.serverError()
                              .entity(Collections.singletonMap("error", ex.getErrorCode()))
                              .build();
  
              }
          }
          return Response.created(URI.create("/" + table)).build();
      }
focal_method.class_method_signature: DocumentResource.saveDocuments(@PathParam("table") final String table, @Valid final List<Document> document)
focal_method.full_signature: @POST @Path("/bulk") public Response saveDocuments(@PathParam("table") final String table, @Valid final List<Document> document)
focal_method.identifier: saveDocuments
focal_method.invocations: save error getErrorCode build entity status singletonMap getErrorCode build entity serverError singletonMap getErrorCode build created create
focal_method.modifiers: @POST @Path("/bulk") public
focal_method.parameters: (@PathParam("table") final String table, @Valid final List<Document> document)
focal_method.return: Response
focal_method.signature: Response saveDocuments(@PathParam("table") final String table, @Valid final List<Document> document)