HtmlSpecificationItem implements Viewable { private void renderOrigin(final String indentation) { final String origin = OriginLinkFormatter.formatAsBlock(this.item.getLocation()); if (!origin.isEmpty()) { this.stream.print(indentation); this.stream.print(" "); this.stream.println(origin); } } HtmlSpecificationItem(final PrintStream stream, final LinkedSpecificationItem item); @Override void render(final int level);  }
@Test void testRenderOrigin() { final Location location = Location.create("foo/bar", 13); final SpecificationItem item = SpecificationItem.builder() .id(ITEM_A_ID) .location(location) .build(); final LinkedSpecificationItem linkedItem = new LinkedSpecificationItem(item); final SpecificationItem subItem = SpecificationItem.builder() .id(ITEM_B_ID).location(Location.create("http: final LinkedSpecificationItem linkedSubItem = new LinkedSpecificationItem(subItem); linkedItem.addLinkToItemWithStatus(linkedSubItem, LinkStatus.COVERED_SHALLOW); final Viewable view = this.factory.createSpecificationItem(linkedItem); view.render(0); assertOutputLines("<section class=\"sitem\" id=\"dsn~name-a~1\">", " <details>", " <summary title=\"dsn~name-a~1\">" + CHECK_MARK + " <b>name-a</b><small>, rev. 1, dsn</small></summary>", " <p class=\"id\">" + ITEM_A_ID + "</p>", " <p class=\"origin\">foo/bar:13</p>", " <div class=\"in\">", " <h6>In: 1</h6>", " <ul>", " <li><a href=\"#" + ITEM_B_ID + "\">" + ITEM_B_ID + "</a> <span class=\"origin\"><a href=\"http: " </ul>", " </div>", " </details>", "</section>", ""); }