@Test public void shouldNotRenderSectionIdForFeatureWithNullName() { final Feature feature = FeatureBuilder.instance().aFeatureWithOneScenarioWithOnePassingStep(); feature.setName(null); List<Feature> features = new ArrayList<>(); features.add(feature); CukedoctorFeatureRenderer featureRenderer = new CukedoctorFeatureRenderer(); assertThat(featureRenderer.renderFeatureSectionId(feature)).isEqualTo(""); }
protected String renderFeatureSectionId(Feature feature) { if (isNull(feature) || not(hasText(feature.getName()))) { return ""; } return "[[" + feature.getName().replaceAll(",", "").replaceAll(" ", "-") + ", " + feature.getName() + "]]"; }
CukedoctorFeatureRenderer extends AbstractBaseRenderer implements FeatureRenderer { protected String renderFeatureSectionId(Feature feature) { if (isNull(feature) || not(hasText(feature.getName()))) { return ""; } return "[[" + feature.getName().replaceAll(",", "").replaceAll(" ", "-") + ", " + feature.getName() + "]]"; } }
CukedoctorFeatureRenderer extends AbstractBaseRenderer implements FeatureRenderer { protected String renderFeatureSectionId(Feature feature) { if (isNull(feature) || not(hasText(feature.getName()))) { return ""; } return "[[" + feature.getName().replaceAll(",", "").replaceAll(" ", "-") + ", " + feature.getName() + "]]"; } CukedoctorFeatureRenderer();  CukedoctorFeatureRenderer(DocumentAttributes documentAttributes);  CukedoctorFeatureRenderer(CukedoctorConfig cukedoctorConfig); }
CukedoctorFeatureRenderer extends AbstractBaseRenderer implements FeatureRenderer { protected String renderFeatureSectionId(Feature feature) { if (isNull(feature) || not(hasText(feature.getName()))) { return ""; } return "[[" + feature.getName().replaceAll(",", "").replaceAll(" ", "-") + ", " + feature.getName() + "]]"; } CukedoctorFeatureRenderer();  CukedoctorFeatureRenderer(DocumentAttributes documentAttributes);  CukedoctorFeatureRenderer(CukedoctorConfig cukedoctorConfig); @Override String renderFeature(Feature feature); @Override String renderFeatures(List<Feature> features); }
CukedoctorFeatureRenderer extends AbstractBaseRenderer implements FeatureRenderer { protected String renderFeatureSectionId(Feature feature) { if (isNull(feature) || not(hasText(feature.getName()))) { return ""; } return "[[" + feature.getName().replaceAll(",", "").replaceAll(" ", "-") + ", " + feature.getName() + "]]"; } CukedoctorFeatureRenderer();  CukedoctorFeatureRenderer(DocumentAttributes documentAttributes);  CukedoctorFeatureRenderer(CukedoctorConfig cukedoctorConfig); @Override String renderFeature(Feature feature); @Override String renderFeatures(List<Feature> features);  }