@Test public void testDelete() { CombinedFeed feed = combinedFeed("1"); datastore.put(feed.getId(), feed); Response response = target("delete").path(feed.getId()).request().post(null); assertEquals(Status.OK.getStatusCode(), response.getStatus()); String html = response.readEntity(String.class); assertTrue(!html.contains(params[0])); }
@POST @Template(name = "/index.ftl") @Path("/delete/{feedId}") public Viewable delete(@PathParam("feedId") String feedId) { Serializable deleted = feedService.delete(feedId); if (deleted != null) { return new Viewable("/index.ftl", getModel()); } else { throw new NotFoundException("No Combined Feed was found with ID: " + feedId); } }
CombinedFeedController { @POST @Template(name = "/index.ftl") @Path("/delete/{feedId}") public Viewable delete(@PathParam("feedId") String feedId) { Serializable deleted = feedService.delete(feedId); if (deleted != null) { return new Viewable("/index.ftl", getModel()); } else { throw new NotFoundException("No Combined Feed was found with ID: " + feedId); } } }
CombinedFeedController { @POST @Template(name = "/index.ftl") @Path("/delete/{feedId}") public Viewable delete(@PathParam("feedId") String feedId) { Serializable deleted = feedService.delete(feedId); if (deleted != null) { return new Viewable("/index.ftl", getModel()); } else { throw new NotFoundException("No Combined Feed was found with ID: " + feedId); } }  }
CombinedFeedController { @POST @Template(name = "/index.ftl") @Path("/delete/{feedId}") public Viewable delete(@PathParam("feedId") String feedId) { Serializable deleted = feedService.delete(feedId); if (deleted != null) { return new Viewable("/index.ftl", getModel()); } else { throw new NotFoundException("No Combined Feed was found with ID: " + feedId); } }  @POST @Template(name = "/index.ftl") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) Viewable create(@Valid @BeanParam FeedRequestBean request); @POST @Template(name = "/index.ftl") @Path("/delete/{feedId}") Viewable delete(@PathParam("feedId") String feedId); @GET @Template(name = "/index.ftl") Viewable getAll(); @GET @Template(name = "/feed-entries.ftl") @Path("/{id}") CombinedFeed get(@PathParam("id") String feedId); }
CombinedFeedController { @POST @Template(name = "/index.ftl") @Path("/delete/{feedId}") public Viewable delete(@PathParam("feedId") String feedId) { Serializable deleted = feedService.delete(feedId); if (deleted != null) { return new Viewable("/index.ftl", getModel()); } else { throw new NotFoundException("No Combined Feed was found with ID: " + feedId); } }  @POST @Template(name = "/index.ftl") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) Viewable create(@Valid @BeanParam FeedRequestBean request); @POST @Template(name = "/index.ftl") @Path("/delete/{feedId}") Viewable delete(@PathParam("feedId") String feedId); @GET @Template(name = "/index.ftl") Viewable getAll(); @GET @Template(name = "/feed-entries.ftl") @Path("/{id}") CombinedFeed get(@PathParam("id") String feedId);  }