From 545e370d9a4fec42181228d7a5ec2caa974dee88 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Wed, 11 Sep 2024 15:12:40 +0100 Subject: [PATCH] Declare use of testResultsOverview build service Closes gh-42265 --- .../boot/build/testing/TestFailuresPlugin.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/buildSrc/src/main/java/org/springframework/boot/build/testing/TestFailuresPlugin.java b/buildSrc/src/main/java/org/springframework/boot/build/testing/TestFailuresPlugin.java index f9ebc52f784..77f7dcf7007 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/testing/TestFailuresPlugin.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/testing/TestFailuresPlugin.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,9 +40,10 @@ public class TestFailuresPlugin implements Plugin { .getSharedServices() .registerIfAbsent("testResultsOverview", TestResultsOverview.class, (spec) -> { }); - project.getTasks() - .withType(Test.class, - (test) -> test.addTestListener(new FailureRecordingTestListener(testResultsOverview, test))); + project.getTasks().withType(Test.class, (test) -> { + test.usesService(testResultsOverview); + test.addTestListener(new FailureRecordingTestListener(testResultsOverview, test)); + }); } private final class FailureRecordingTestListener implements TestListener {