Skip to content

Commit 545e370

Browse files
committed
Declare use of testResultsOverview build service
Closes gh-42265
1 parent 504fd62 commit 545e370

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

buildSrc/src/main/java/org/springframework/boot/build/testing/TestFailuresPlugin.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -40,9 +40,10 @@ public void apply(Project project) {
4040
.getSharedServices()
4141
.registerIfAbsent("testResultsOverview", TestResultsOverview.class, (spec) -> {
4242
});
43-
project.getTasks()
44-
.withType(Test.class,
45-
(test) -> test.addTestListener(new FailureRecordingTestListener(testResultsOverview, test)));
43+
project.getTasks().withType(Test.class, (test) -> {
44+
test.usesService(testResultsOverview);
45+
test.addTestListener(new FailureRecordingTestListener(testResultsOverview, test));
46+
});
4647
}
4748

4849
private final class FailureRecordingTestListener implements TestListener {

0 commit comments

Comments
 (0)