@Test public void testGetEntriesHTML() { String entityID = "1"; CombinedFeed feedWithEntries = CombinedFeed.CombinedFeedBuilder .of(combinedFeed(entityID)) .feedEntries(feedEntries()) .build(); datastore.put(entityID, feedWithEntries); Response response = target().path(entityID).request(TEXT_HTML_TYPE).get(); assertEquals(Status.OK.getStatusCode(), response.getStatus()); String html = response.readEntity(String.class); assertTrue(html.contains("<td>title1</td>") && html.contains("<td>title2</td>")); assertTrue(html.contains("<td><a href=\"link1\">link1</a></td>") && html.contains("<td><a href=\"link2\">link2</a></td>")); }
@GET @Template(name = "/feed-entries.ftl") @Path("/{id}") public CombinedFeed get(@PathParam("id") String feedId) { CombinedFeed combinedFeed = feedService.get(feedId); if (combinedFeed != null) { return combinedFeed; } else { throw new NotFoundException("No Combined Feed was found with ID: " + feedId); } }
CombinedFeedController { @GET @Template(name = "/feed-entries.ftl") @Path("/{id}") public CombinedFeed get(@PathParam("id") String feedId) { CombinedFeed combinedFeed = feedService.get(feedId); if (combinedFeed != null) { return combinedFeed; } else { throw new NotFoundException("No Combined Feed was found with ID: " + feedId); } } }
CombinedFeedController { @GET @Template(name = "/feed-entries.ftl") @Path("/{id}") public CombinedFeed get(@PathParam("id") String feedId) { CombinedFeed combinedFeed = feedService.get(feedId); if (combinedFeed != null) { return combinedFeed; } else { throw new NotFoundException("No Combined Feed was found with ID: " + feedId); } }  }
CombinedFeedController { @GET @Template(name = "/feed-entries.ftl") @Path("/{id}") public CombinedFeed get(@PathParam("id") String feedId) { CombinedFeed combinedFeed = feedService.get(feedId); if (combinedFeed != null) { return combinedFeed; } 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 { @GET @Template(name = "/feed-entries.ftl") @Path("/{id}") public CombinedFeed get(@PathParam("id") String feedId) { CombinedFeed combinedFeed = feedService.get(feedId); if (combinedFeed != null) { return combinedFeed; } 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);  }