@Test public void shouldNotRenderIfSectionHasNoChildren() { final BasicSection section = createSection(); final String result = section.render(CukedoctorDocumentBuilder.Factory.newInstance(), I18nLoader.instance(null), new DocumentAttributes()); assertEquals("", result); }
@Override public String render(CukedoctorDocumentBuilder docBuilder, I18nLoader i18n, DocumentAttributes documentAttributes) { if (!hasRoot() && sectionsByGroup.isEmpty() && grouplessFeatures.isEmpty()) return ""; renderName(docBuilder, i18n, documentAttributes); renderChildren(docBuilder, i18n, documentAttributes); return docBuilder.toString(); }
BasicSection implements Section { @Override public String render(CukedoctorDocumentBuilder docBuilder, I18nLoader i18n, DocumentAttributes documentAttributes) { if (!hasRoot() && sectionsByGroup.isEmpty() && grouplessFeatures.isEmpty()) return ""; renderName(docBuilder, i18n, documentAttributes); renderChildren(docBuilder, i18n, documentAttributes); return docBuilder.toString(); } }
BasicSection implements Section { @Override public String render(CukedoctorDocumentBuilder docBuilder, I18nLoader i18n, DocumentAttributes documentAttributes) { if (!hasRoot() && sectionsByGroup.isEmpty() && grouplessFeatures.isEmpty()) return ""; renderName(docBuilder, i18n, documentAttributes); renderChildren(docBuilder, i18n, documentAttributes); return docBuilder.toString(); } BasicSection(String id);  BasicSection(String id, String style);  BasicSection(String id, String style, String groupingTagPattern); }
BasicSection implements Section { @Override public String render(CukedoctorDocumentBuilder docBuilder, I18nLoader i18n, DocumentAttributes documentAttributes) { if (!hasRoot() && sectionsByGroup.isEmpty() && grouplessFeatures.isEmpty()) return ""; renderName(docBuilder, i18n, documentAttributes); renderChildren(docBuilder, i18n, documentAttributes); return docBuilder.toString(); } BasicSection(String id);  BasicSection(String id, String style);  BasicSection(String id, String style, String groupingTagPattern); @Override Section addFeature(Feature feature); @Override String render(CukedoctorDocumentBuilder docBuilder, I18nLoader i18n, DocumentAttributes documentAttributes); @Override int getOrder(); @Override Stream<Feature> getFeatures(); }
BasicSection implements Section { @Override public String render(CukedoctorDocumentBuilder docBuilder, I18nLoader i18n, DocumentAttributes documentAttributes) { if (!hasRoot() && sectionsByGroup.isEmpty() && grouplessFeatures.isEmpty()) return ""; renderName(docBuilder, i18n, documentAttributes); renderChildren(docBuilder, i18n, documentAttributes); return docBuilder.toString(); } BasicSection(String id);  BasicSection(String id, String style);  BasicSection(String id, String style, String groupingTagPattern); @Override Section addFeature(Feature feature); @Override String render(CukedoctorDocumentBuilder docBuilder, I18nLoader i18n, DocumentAttributes documentAttributes); @Override int getOrder(); @Override Stream<Feature> getFeatures();  }