Skip to content

Commit e80df6b

Browse files
wilkinsonaphilwebb
authored andcommitted
Remove spring-boot-autoconfigure-all
Issue: 46071
1 parent e50843f commit e80df6b

File tree

13 files changed

+92
-204
lines changed

13 files changed

+92
-204
lines changed

settings.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ include "spring-boot-project:spring-boot-actuator-integration-tests"
6565
include "spring-boot-project:spring-boot-amqp"
6666
include "spring-boot-project:spring-boot-artemis"
6767
include "spring-boot-project:spring-boot-autoconfigure"
68-
include "spring-boot-project:spring-boot-autoconfigure-all"
6968
include "spring-boot-project:spring-boot-batch"
7069
include "spring-boot-project:spring-boot-cache"
7170
include "spring-boot-project:spring-boot-cassandra"

spring-boot-project/spring-boot-autoconfigure-all/build.gradle

Lines changed: 0 additions & 48 deletions
This file was deleted.

spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/servlet/FilterOrderingIntegrationTests.java

Lines changed: 0 additions & 138 deletions
This file was deleted.

spring-boot-project/spring-boot-autoconfigure-all/src/test/resources/logback-test.xml

Lines changed: 0 additions & 4 deletions
This file was deleted.

spring-boot-project/spring-boot-dependencies/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1990,7 +1990,6 @@ bom {
19901990
"spring-boot-amqp",
19911991
"spring-boot-artemis",
19921992
"spring-boot-autoconfigure",
1993-
"spring-boot-autoconfigure-all",
19941993
"spring-boot-autoconfigure-processor",
19951994
"spring-boot-batch",
19961995
"spring-boot-buildpack-platform",

spring-boot-project/spring-boot-devtools/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ artifacts {
4040

4141
dependencies {
4242
api(project(":spring-boot-project:spring-boot"))
43-
api(project(":spring-boot-project:spring-boot-autoconfigure-all"))
43+
api(project(":spring-boot-project:spring-boot-autoconfigure"))
4444

4545
intTestDependencies(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-web"))
4646

47-
intTestImplementation(project(":spring-boot-project:spring-boot-autoconfigure-all"))
47+
intTestImplementation(project(":spring-boot-project:spring-boot-autoconfigure"))
4848
intTestImplementation(project(":spring-boot-project:spring-boot-restclient"))
4949
intTestImplementation(project(":spring-boot-project:spring-boot-test"))
5050
intTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))

spring-boot-project/spring-boot-docker-compose-all/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ dependencies {
5757
optional(project(":spring-boot-project:spring-boot-activemq"))
5858
optional(project(":spring-boot-project:spring-boot-amqp"))
5959
optional(project(":spring-boot-project:spring-boot-artemis"))
60-
optional(project(":spring-boot-project:spring-boot-autoconfigure-all"))
6160
optional(project(":spring-boot-project:spring-boot-actuator-autoconfigure-all"))
6261
optional(project(":spring-boot-project:spring-boot-cassandra"))
6362
optional(project(":spring-boot-project:spring-boot-data-redis"))

spring-boot-project/spring-boot-docs/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,6 @@ dependencies {
249249
implementation(project(path: ":spring-boot-project:spring-boot-actuator-autoconfigure"))
250250
implementation(project(path: ":spring-boot-project:spring-boot-actuator-autoconfigure-all"))
251251
implementation(project(path: ":spring-boot-project:spring-boot-amqp"))
252-
implementation(project(path: ":spring-boot-project:spring-boot-autoconfigure-all"))
253252
implementation(project(path: ":spring-boot-project:spring-boot-cache"))
254253
implementation(project(path: ":spring-boot-project:spring-boot-data-cassandra"))
255254
implementation(project(path: ":spring-boot-project:spring-boot-data-elasticsearch"))

spring-boot-project/spring-boot-security/src/test/java/org/springframework/boot/security/autoconfigure/servlet/SecurityFilterAutoConfigurationTests.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package org.springframework.boot.security.autoconfigure.servlet;
1818

19+
import org.assertj.core.api.Assertions;
1920
import org.junit.jupiter.api.Test;
2021

2122
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
@@ -26,13 +27,17 @@
2627
import org.springframework.boot.security.autoconfigure.servlet.SecurityFilterAutoConfigurationEarlyInitializationTests.DeserializerBean;
2728
import org.springframework.boot.security.autoconfigure.servlet.SecurityFilterAutoConfigurationEarlyInitializationTests.ExampleController;
2829
import org.springframework.boot.security.autoconfigure.servlet.SecurityFilterAutoConfigurationEarlyInitializationTests.JacksonModuleBean;
30+
import org.springframework.boot.servlet.filter.OrderedRequestContextFilter;
2931
import org.springframework.boot.web.context.servlet.AnnotationConfigServletWebApplicationContext;
32+
import org.springframework.boot.web.servlet.DelegatingFilterProxyRegistrationBean;
3033
import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration;
3134
import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration;
3235
import org.springframework.context.annotation.Configuration;
3336
import org.springframework.context.annotation.Import;
3437
import org.springframework.mock.web.MockServletContext;
3538

39+
import static org.assertj.core.api.Assertions.assertThat;
40+
3641
/**
3742
* Tests for {@link SecurityFilterAutoConfiguration}.
3843
*
@@ -49,6 +54,20 @@ void filterAutoConfigurationWorksWithoutSecurityAutoConfiguration() {
4954
}
5055
}
5156

57+
@Test
58+
void filterIsOrderedShortlyAfterRequestContextFilter() {
59+
try (AnnotationConfigServletWebApplicationContext context = new AnnotationConfigServletWebApplicationContext()) {
60+
context.setServletContext(new MockServletContext());
61+
context.register(SecurityAutoConfiguration.class);
62+
context.register(Config.class);
63+
context.refresh();
64+
int securityFilterOrder = context.getBean(DelegatingFilterProxyRegistrationBean.class).getOrder();
65+
int requestContextFilterOrder = new OrderedRequestContextFilter().getOrder();
66+
assertThat(securityFilterOrder).isGreaterThan(requestContextFilterOrder)
67+
.isCloseTo(requestContextFilterOrder, Assertions.within(5));
68+
}
69+
}
70+
5271
@Configuration(proxyBeanMethods = false)
5372
@Import({ DeserializerBean.class, JacksonModuleBean.class, ExampleController.class, ConverterBean.class })
5473
@ImportAutoConfiguration({ WebMvcAutoConfiguration.class, JacksonAutoConfiguration.class,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
* Copyright 2012-present the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.boot.servlet.filter;
18+
19+
import java.util.ArrayList;
20+
import java.util.List;
21+
22+
import org.assertj.core.api.Assertions;
23+
import org.junit.jupiter.api.Test;
24+
25+
import org.springframework.core.annotation.AnnotationAwareOrderComparator;
26+
27+
import static org.assertj.core.api.Assertions.assertThat;
28+
29+
/**
30+
* Tests for the ordering of various {@link OrderedFilter} implementations.
31+
*
32+
* @author Andy Wilkinson
33+
*/
34+
class OrderedFilterOrderingTests {
35+
36+
@Test
37+
void ordering() {
38+
OrderedCharacterEncodingFilter characterEncoding = new OrderedCharacterEncodingFilter();
39+
OrderedFormContentFilter formContent = new OrderedFormContentFilter();
40+
OrderedHiddenHttpMethodFilter hiddenHttpMethod = new OrderedHiddenHttpMethodFilter();
41+
OrderedRequestContextFilter requestContext = new OrderedRequestContextFilter();
42+
List<OrderedFilter> filters = new ArrayList<>(
43+
List.of(characterEncoding, formContent, hiddenHttpMethod, requestContext));
44+
AnnotationAwareOrderComparator.sort(filters);
45+
assertThat(filters).containsExactly(characterEncoding, hiddenHttpMethod, formContent, requestContext);
46+
}
47+
48+
@Test
49+
void requestContextOrderingIsCloseToRequestWrapperFilterMaxOrder() {
50+
assertThat(new OrderedRequestContextFilter().getOrder())
51+
.isCloseTo(OrderedFilter.REQUEST_WRAPPER_FILTER_MAX_ORDER, Assertions.within(105));
52+
}
53+
54+
}

0 commit comments

Comments
 (0)