From c2cb4f2bb1aa895576833bbaa4e589dc9f5625ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Tue, 3 Mar 2026 10:44:00 +0100 Subject: [PATCH] Fix broken test setup --- .../servlet/support/SpringBootServletInitializerTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializerTests.java b/core/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializerTests.java index cdb4904908f..affd5bb56c4 100644 --- a/core/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializerTests.java +++ b/core/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/SpringBootServletInitializerTests.java @@ -35,7 +35,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentCaptor; -import org.springframework.boot.DefaultApplicationArguments; import org.springframework.boot.SpringApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent; @@ -189,7 +188,8 @@ class SpringBootServletInitializerTests { @Test void executableWarThatUsesServletInitializerDoesNotHaveErrorPageFilterConfigured() { - try (ConfigurableApplicationContext context = new SpringApplication(DefaultApplicationArguments.class).run()) { + try (ConfigurableApplicationContext context = new SpringApplication(DefaultSpringBootServletInitializer.class) + .run()) { assertThat(context.getBeansOfType(ErrorPageFilter.class)).isEmpty(); } }