Skip to content

Commit fd3f569

Browse files
committed
Refactor
1 parent 6856ff4 commit fd3f569

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎testng/src/test/java/com/baeldung/reports/CustomisedReports.java‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,12 @@ public class CustomisedReports implements IReporter {
2525
public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String outputDirectory) {
2626
String reportTemplate = initReportTemplate();
2727

28-
final List<String> rows = suites
28+
final String body = suites
2929
.stream()
3030
.flatMap(suiteToResults())
31-
.collect(Collectors.toList());
31+
.collect(Collectors.joining());
3232

33-
reportTemplate = reportTemplate.replaceFirst("</tbody>", rows.toString() + "</tbody>");
34-
saveReportTemplate(outputDirectory, reportTemplate);
33+
saveReportTemplate(outputDirectory, reportTemplate.replaceFirst("</tbody>", String.format("%s</tbody>", body)));
3534
}
3635

3736
private Function<ISuite, Stream<? extends String>> suiteToResults() {

0 commit comments

Comments
 (0)