From 77afe76ed56b2016c0720b38d3677053c2baab11 Mon Sep 17 00:00:00 2001 From: Marten Deinum Date: Mon, 24 Sep 2018 20:53:55 +0200 Subject: [PATCH 1/2] Polish The SpringBootContextLoader still checked if tests were annotated with @IntegrationTest or @WebIntegrationTest. Those classes have been removed in Spring Boot 1.5 and been deprecated since 1.4. This commit removes the check on the annotations as well as the static list of names. See gh-14592 --- .../boot/test/context/SpringBootContextLoader.java | 14 -------------- 1 file changed, 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 1250f39fdb..b6f6ae92ed 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 @@ -80,15 +80,6 @@ import org.springframework.web.context.support.GenericWebApplicationContext; */ public class SpringBootContextLoader extends AbstractContextLoader { - private static final Set INTEGRATION_TEST_ANNOTATIONS; - - static { - Set annotations = new LinkedHashSet<>(); - annotations.add("org.springframework.boot.test.IntegrationTest"); - annotations.add("org.springframework.boot.test.WebIntegrationTest"); - INTEGRATION_TEST_ANNOTATIONS = Collections.unmodifiableSet(annotations); - } - @Override public ApplicationContext loadContext(MergedContextConfiguration config) throws Exception { @@ -222,11 +213,6 @@ public class SpringBootContextLoader extends AbstractContextLoader { } private boolean isEmbeddedWebEnvironment(MergedContextConfiguration config) { - for (String annotation : INTEGRATION_TEST_ANNOTATIONS) { - if (AnnotatedElementUtils.isAnnotated(config.getTestClass(), annotation)) { - return true; - } - } SpringBootTest annotation = AnnotatedElementUtils .findMergedAnnotation(config.getTestClass(), SpringBootTest.class); if (annotation != null && annotation.webEnvironment().isEmbedded()) { From b6e5103dc42ffc5c5268e2960f94ad30824a4b19 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Wed, 26 Sep 2018 11:43:19 -0400 Subject: [PATCH 2/2] Polish contribution Closes gh-14592 --- .../boot/test/context/SpringBootContextLoader.java | 3 --- 1 file changed, 3 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 b6f6ae92ed..e68b80c7a3 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 @@ -18,10 +18,7 @@ package org.springframework.boot.test.context; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; -import java.util.LinkedHashSet; import java.util.List; -import java.util.Set; import org.springframework.beans.BeanUtils; import org.springframework.boot.SpringApplication;