### Question:
DocumentResource { @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(); } } } DocumentResource(QueryStore queryStore); @POST Response saveDocument(@PathParam("table") final String table, @Valid final Document document); @POST @Path("/bulk") Response saveDocuments(@PathParam("table") final String table, @Valid final List<Document> document); @GET @Path("/{id}") Response getDocument(@PathParam("table") final String table, @PathParam("id") @NotNull final String id); @GET Response getDocuments(@PathParam("table") final String table, @QueryParam("id") @NotNull final List<String> ids);  }### Answer:
@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); }