net.masterthought.cucumber.reducers.ReportFeatureMergerFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cucumber-reporting Show documentation
Show all versions of cucumber-reporting Show documentation
Provides pretty html reports for Cucumber (Behaviour-Driven Development). It works by generating html from the
cucumber json report formatter. So can be used anywhere a json report is generated. Current use is in the
cucumber jenkins plugin and a maven mojo to generate the same report from mvn command line when running locally.
package net.masterthought.cucumber.reducers;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import static java.util.Collections.emptyList;
public final class ReportFeatureMergerFactory {
private List mergers = Arrays.asList(
new ReportFeatureByIdMerger(),
new ReportFeatureWithRetestMerger()
);
/**
* @param reducingMethods - full list of reduce methods.
* @return a merger for features by ReduceMethod with a priority mentioned in the method.
*/
public ReportFeatureMerger get(List reducingMethods) {
List methods = Optional.ofNullable(reducingMethods).orElse(emptyList());
return mergers.stream()
.filter(m -> m.test(methods))
.findFirst()
.orElse(new ReportFeatureAppendableMerger());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy