コード例 #1
0
 private void checkCommentLinks(String url, Comment comment) {
   Assert.assertNotNull(comment);
   Assert.assertEquals(0, comment.getId());
   RESTServiceDiscovery links = comment.getRest();
   Assert.assertNotNull(links);
   Assert.assertEquals(6, links.size());
   // self
   AtomLink atomLink = links.getLinkForRel("self");
   Assert.assertNotNull(atomLink);
   Assert.assertEquals(url + "/book/foo/comment/0", atomLink.getHref());
   // update
   atomLink = links.getLinkForRel("update");
   Assert.assertNotNull(atomLink);
   Assert.assertEquals(url + "/book/foo/comment/0", atomLink.getHref());
   // remove
   atomLink = links.getLinkForRel("remove");
   Assert.assertNotNull(atomLink);
   Assert.assertEquals(url + "/book/foo/comment/0", atomLink.getHref());
   // list
   atomLink = links.getLinkForRel("list");
   Assert.assertNotNull(atomLink);
   Assert.assertEquals(url + "/book/foo/comments", atomLink.getHref());
   // add
   atomLink = links.getLinkForRel("add");
   Assert.assertNotNull(atomLink);
   Assert.assertEquals(url + "/book/foo/comments", atomLink.getHref());
   // collection
   atomLink = links.getLinkForRel("collection");
   Assert.assertNotNull(atomLink);
   Assert.assertEquals(url + "/book/foo/comment-collection", atomLink.getHref());
 }
コード例 #2
0
 private void checkCommentsLinks(String url, ScrollableCollection comments) {
   Assert.assertNotNull(comments);
   RESTServiceDiscovery links = comments.getRest();
   Assert.assertNotNull(links);
   Assert.assertEquals(3, links.size());
   // list
   AtomLink atomLink = links.getLinkForRel("list");
   Assert.assertNotNull(atomLink);
   Assert.assertEquals(url + "/book/foo/comments", atomLink.getHref());
   // add
   atomLink = links.getLinkForRel("add");
   Assert.assertNotNull(atomLink);
   Assert.assertEquals(url + "/book/foo/comments", atomLink.getHref());
   // comment collection
   atomLink = links.getLinkForRel("collection");
   Assert.assertNotNull(atomLink);
   Assert.assertEquals(url + "/book/foo/comment-collection", atomLink.getHref());
 }