class 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();
    }

}

class TableManagerResourceTest  {

    @Rule
    public ResourceTestRule resources;
    private TableManager tableManager;

    @Test
    public void testGet() throws Exception {

        doNothing().when(getDataStore())
                .initializeTable(any(Table.class), anyBoolean());
        doNothing().when(getQueryStore())
                .initializeTable(any(String.class));


        Table response = resources.client()
                .target(String.format("/v1/tables/%s", TEST_TABLE_NAME))
                .request()
                .get(Table.class);
        assertNotNull(response);
        assertEquals(TEST_TABLE_NAME, response.getName());
        assertEquals(7, response.getTtl());
    }

}