@Test public void testGetMissingTable() throws Exception { Response response = resources.client() .target(String.format("/v1/tables/%s", TEST_TABLE_NAME + "_missing")) .request() .get(); assertEquals(Response.Status.NOT_FOUND.getStatusCode(), response.getStatus()); }
@GET @Timed @Path("/{name}") @ApiOperation("Get Table") public Response get(@PathParam("name") String name) { name = ElasticsearchUtils.getValidTableName(name); Table table = tableManager.get(name); return Response.ok() .entity(table) .build(); }
TableManagerResource { @GET @Timed @Path("/{name}") @ApiOperation("Get Table") public Response get(@PathParam("name") String name) { name = ElasticsearchUtils.getValidTableName(name); Table table = tableManager.get(name); return Response.ok() .entity(table) .build(); } }
TableManagerResource { @GET @Timed @Path("/{name}") @ApiOperation("Get Table") public Response get(@PathParam("name") String name) { name = ElasticsearchUtils.getValidTableName(name); Table table = tableManager.get(name); return Response.ok() .entity(table) .build(); } @Inject  TableManagerResource(TableManager tableManager); }
TableManagerResource { @GET @Timed @Path("/{name}") @ApiOperation("Get Table") public Response get(@PathParam("name") String name) { name = ElasticsearchUtils.getValidTableName(name); Table table = tableManager.get(name); return Response.ok() .entity(table) .build(); } @Inject  TableManagerResource(TableManager tableManager); @POST @Timed @ApiOperation("Save Table") Response save(@Valid final Table table, @QueryParam("forceCreate") @DefaultValue("false") boolean forceCreate); @GET @Timed @Path("/{name}") @ApiOperation("Get Table") Response get(@PathParam("name") String name); @PUT @Timed @Path("/{name}") @ApiOperation("Update Table") Response get(@PathParam("name") final String name, @Valid final Table table); @DELETE @Timed @Path("/{name}/delete") @ApiOperation("Delete Table") Response delete(@PathParam("name") String name); @GET @Timed @ApiOperation("Get all Tables") Response getAll(); }
TableManagerResource { @GET @Timed @Path("/{name}") @ApiOperation("Get Table") public Response get(@PathParam("name") String name) { name = ElasticsearchUtils.getValidTableName(name); Table table = tableManager.get(name); return Response.ok() .entity(table) .build(); } @Inject  TableManagerResource(TableManager tableManager); @POST @Timed @ApiOperation("Save Table") Response save(@Valid final Table table, @QueryParam("forceCreate") @DefaultValue("false") boolean forceCreate); @GET @Timed @Path("/{name}") @ApiOperation("Get Table") Response get(@PathParam("name") String name); @PUT @Timed @Path("/{name}") @ApiOperation("Update Table") Response get(@PathParam("name") final String name, @Valid final Table table); @DELETE @Timed @Path("/{name}/delete") @ApiOperation("Delete Table") Response delete(@PathParam("name") String name); @GET @Timed @ApiOperation("Get all Tables") Response getAll();  }