Refactor
This commit is contained in:
parent
6856ff42ad
commit
fd3f569f20
@ -25,13 +25,12 @@ public class CustomisedReports implements IReporter {
|
|||||||
public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String outputDirectory) {
|
public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String outputDirectory) {
|
||||||
String reportTemplate = initReportTemplate();
|
String reportTemplate = initReportTemplate();
|
||||||
|
|
||||||
final List<String> rows = suites
|
final String body = suites
|
||||||
.stream()
|
.stream()
|
||||||
.flatMap(suiteToResults())
|
.flatMap(suiteToResults())
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.joining());
|
||||||
|
|
||||||
reportTemplate = reportTemplate.replaceFirst("</tbody>", rows.toString() + "</tbody>");
|
saveReportTemplate(outputDirectory, reportTemplate.replaceFirst("</tbody>", String.format("%s</tbody>", body)));
|
||||||
saveReportTemplate(outputDirectory, reportTemplate);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Function<ISuite, Stream<? extends String>> suiteToResults() {
|
private Function<ISuite, Stream<? extends String>> suiteToResults() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user