@Test public void shouldNotRenderIfFeatureOnlyHasOrderTagsAndScenarioHasNoTags() { assertEquals( "", tagsRenderer.renderScenarioTags(createFeature(order42, order1), createEmptyScenario(), CukedoctorDocumentBuilder.Factory.newInstance()) ); }
@Override public String renderScenarioTags(Feature feature, Scenario scenario) { docBuilder.clear(); int expectedSize = (feature.hasTags() ? feature.getTags().size() : 0) + (scenario.hasTags() ? scenario.getTags().size() : 0); if (expectedSize == 0) return ""; HashSet<String> tagNames = new HashSet<>(expectedSize); extractTagNames(tagNames, feature.getTags()); extractTagNames(tagNames, scenario.getTags()); if (tagNames.size() == 0) return ""; docBuilder.clear(); StringBuilder tags = new StringBuilder("[small]#tags: "); for (String tagName : tagNames) { tags.append(tagName).append(","); } if (tags.indexOf(",") != -1) { tags.deleteCharAt(tags.lastIndexOf(",")); } tags.append("#"); docBuilder.textLine(tags.toString()); docBuilder.newLine(); return docBuilder.toString(); }
CukedoctorTagsRenderer extends AbstractBaseRenderer implements TagsRenderer { @Override public String renderScenarioTags(Feature feature, Scenario scenario) { docBuilder.clear(); int expectedSize = (feature.hasTags() ? feature.getTags().size() : 0) + (scenario.hasTags() ? scenario.getTags().size() : 0); if (expectedSize == 0) return ""; HashSet<String> tagNames = new HashSet<>(expectedSize); extractTagNames(tagNames, feature.getTags()); extractTagNames(tagNames, scenario.getTags()); if (tagNames.size() == 0) return ""; docBuilder.clear(); StringBuilder tags = new StringBuilder("[small]#tags: "); for (String tagName : tagNames) { tags.append(tagName).append(","); } if (tags.indexOf(",") != -1) { tags.deleteCharAt(tags.lastIndexOf(",")); } tags.append("#"); docBuilder.textLine(tags.toString()); docBuilder.newLine(); return docBuilder.toString(); } }
CukedoctorTagsRenderer extends AbstractBaseRenderer implements TagsRenderer { @Override public String renderScenarioTags(Feature feature, Scenario scenario) { docBuilder.clear(); int expectedSize = (feature.hasTags() ? feature.getTags().size() : 0) + (scenario.hasTags() ? scenario.getTags().size() : 0); if (expectedSize == 0) return ""; HashSet<String> tagNames = new HashSet<>(expectedSize); extractTagNames(tagNames, feature.getTags()); extractTagNames(tagNames, scenario.getTags()); if (tagNames.size() == 0) return ""; docBuilder.clear(); StringBuilder tags = new StringBuilder("[small]#tags: "); for (String tagName : tagNames) { tags.append(tagName).append(","); } if (tags.indexOf(",") != -1) { tags.deleteCharAt(tags.lastIndexOf(",")); } tags.append("#"); docBuilder.textLine(tags.toString()); docBuilder.newLine(); return docBuilder.toString(); }  }
CukedoctorTagsRenderer extends AbstractBaseRenderer implements TagsRenderer { @Override public String renderScenarioTags(Feature feature, Scenario scenario) { docBuilder.clear(); int expectedSize = (feature.hasTags() ? feature.getTags().size() : 0) + (scenario.hasTags() ? scenario.getTags().size() : 0); if (expectedSize == 0) return ""; HashSet<String> tagNames = new HashSet<>(expectedSize); extractTagNames(tagNames, feature.getTags()); extractTagNames(tagNames, scenario.getTags()); if (tagNames.size() == 0) return ""; docBuilder.clear(); StringBuilder tags = new StringBuilder("[small]#tags: "); for (String tagName : tagNames) { tags.append(tagName).append(","); } if (tags.indexOf(",") != -1) { tags.deleteCharAt(tags.lastIndexOf(",")); } tags.append("#"); docBuilder.textLine(tags.toString()); docBuilder.newLine(); return docBuilder.toString(); }  @Override String renderScenarioTags(Feature feature, Scenario scenario); }
CukedoctorTagsRenderer extends AbstractBaseRenderer implements TagsRenderer { @Override public String renderScenarioTags(Feature feature, Scenario scenario) { docBuilder.clear(); int expectedSize = (feature.hasTags() ? feature.getTags().size() : 0) + (scenario.hasTags() ? scenario.getTags().size() : 0); if (expectedSize == 0) return ""; HashSet<String> tagNames = new HashSet<>(expectedSize); extractTagNames(tagNames, feature.getTags()); extractTagNames(tagNames, scenario.getTags()); if (tagNames.size() == 0) return ""; docBuilder.clear(); StringBuilder tags = new StringBuilder("[small]#tags: "); for (String tagName : tagNames) { tags.append(tagName).append(","); } if (tags.indexOf(",") != -1) { tags.deleteCharAt(tags.lastIndexOf(",")); } tags.append("#"); docBuilder.textLine(tags.toString()); docBuilder.newLine(); return docBuilder.toString(); }  @Override String renderScenarioTags(Feature feature, Scenario scenario);  }