HtmlSpecificationItem implements Viewable { private void renderNeeds(final String indentation) { if ((this.item.getNeedsArtifactTypes() != null && !this.item.getNeedsArtifactTypes().isEmpty()) || (this.item.getUncoveredArtifactTypes() != null && !this.item.getUncoveredArtifactTypes().isEmpty()) || (this.item.getOverCoveredArtifactTypes() != null && !this.item.getOverCoveredArtifactTypes().isEmpty())) { this.stream.print(indentation); this.stream.print(" <h6>Needs: "); this.stream.print(translateArtifactTypeCoverage(this.item)); this.stream.println("</h6>"); } } HtmlSpecificationItem(final PrintStream stream, final LinkedSpecificationItem item); @Override void render(final int level);  }
@Test void testRenderNeeds() { final SpecificationItem item = SpecificationItem.builder() .id(ITEM_A_ID) .addNeedsArtifactType(IMPL) .addNeedsArtifactType(UTEST) .build(); final LinkedSpecificationItem linkedItem = new LinkedSpecificationItem(item); linkedItem.addCoveredArtifactType(IMPL); linkedItem.addOverCoveredArtifactType(ITEST); 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\">" + CROSS_MARK + " <b>name-a</b><small>, rev. 1, dsn</small></summary>", " <p class=\"id\">" + ITEM_A_ID + "</p>", " <h6>Needs: impl, <del>itest</del>, <ins>utest</ins></h6>", " </details>", "</section>", ""); }