From dd87cf47a4e57f3eb83fdffc8a213faffabb90a8 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Wed, 3 Aug 2022 15:37:51 +0100 Subject: [PATCH] Revert SpringBootContextLoader and ErrorPageFilterIntegrationTests changes" Spring Framework has change the signature so we no longer need the updates. --- .../boot/test/context/SpringBootContextLoader.java | 7 ------- .../servlet/support/ErrorPageFilterIntegrationTests.java | 8 +------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootContextLoader.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootContextLoader.java index fa11e64f3ed..cd258e5deae 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootContextLoader.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/SpringBootContextLoader.java @@ -84,13 +84,7 @@ import org.springframework.web.context.support.GenericWebApplicationContext; public class SpringBootContextLoader extends AbstractContextLoader { @Override - @Deprecated public ApplicationContext loadContext(MergedContextConfiguration config) throws Exception { - return loadContext(config, true); - } - - @Override - public ApplicationContext loadContext(MergedContextConfiguration config, boolean refresh) throws Exception { Class[] configClasses = config.getClasses(); String[] configLocations = config.getLocations(); Assert.state(!ObjectUtils.isEmpty(configClasses) || !ObjectUtils.isEmpty(configLocations), @@ -135,7 +129,6 @@ public class SpringBootContextLoader extends AbstractContextLoader { application.addListeners(new PrepareEnvironmentListener(config)); } String[] args = SpringBootTestArgs.get(config.getContextCustomizers()); - Assert.isTrue(refresh, "SpringBootContextLoader and only return refreshed contexts"); return application.run(args); } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/ErrorPageFilterIntegrationTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/ErrorPageFilterIntegrationTests.java index 918e8c0022f..565bcd2307b 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/ErrorPageFilterIntegrationTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/ErrorPageFilterIntegrationTests.java @@ -179,13 +179,7 @@ class ErrorPageFilterIntegrationTests { private static final String[] EMPTY_RESOURCE_SUFFIXES = {}; @Override - @Deprecated - public ApplicationContext loadContext(MergedContextConfiguration mergedConfig) throws Exception { - return loadContext(mergedConfig, true); - } - - @Override - public ApplicationContext loadContext(MergedContextConfiguration config, boolean refresh) { + public ApplicationContext loadContext(MergedContextConfiguration config) { AnnotationConfigServletWebServerApplicationContext context = new AnnotationConfigServletWebServerApplicationContext( config.getClasses()); context.registerShutdownHook();