From fb207f73e75c1be47136eea18c714414fe8ded92 Mon Sep 17 00:00:00 2001 From: dreis2211 Date: Thu, 17 Dec 2020 16:38:21 +0100 Subject: [PATCH] Remove deprecated SpringBootContextLoader#getArgs() See gh-24550 --- .../test/context/SpringBootContextLoader.java | 16 ++-------------- 1 file changed, 2 insertions(+), 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 d1edcba1656..39fcd6a9ca1 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 @@ -119,7 +119,8 @@ public class SpringBootContextLoader extends AbstractContextLoader { application.setWebApplicationType(WebApplicationType.NONE); } application.setInitializers(initializers); - return application.run(getArgs(config)); + String[] args = SpringBootTestArgs.get(config.getContextCustomizers()); + return application.run(args); } /** @@ -140,19 +141,6 @@ public class SpringBootContextLoader extends AbstractContextLoader { return new StandardEnvironment(); } - /** - * Return the application arguments to use. If no arguments are available, return an - * empty array. - * @param config the source context configuration - * @return the application arguments to use - * @deprecated since 2.2.7 - * @see SpringApplication#run(String...) - */ - @Deprecated - protected String[] getArgs(MergedContextConfiguration config) { - return SpringBootTestArgs.get(config.getContextCustomizers()); - } - private void setActiveProfiles(ConfigurableEnvironment environment, String[] profiles) { environment.setActiveProfiles(profiles); // Also add as properties to override any application.properties