Skip to content

Commit dc5acb0

Browse files
committed
Remove deprecated code flagged for removal
Closes gh-27303
1 parent 46ad4c6 commit dc5acb0

File tree

82 files changed

+183
-2508
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+183
-2508
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cassandra/CassandraHealthContributorAutoConfiguration.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -42,9 +42,7 @@
4242
@ConditionalOnEnabledHealthIndicator("cassandra")
4343
@AutoConfigureAfter({ CassandraAutoConfiguration.class, CassandraDataAutoConfiguration.class,
4444
CassandraReactiveHealthContributorAutoConfiguration.class })
45-
@Import({ CassandraDriverConfiguration.class,
46-
CassandraHealthContributorConfigurations.CassandraOperationsConfiguration.class })
47-
@SuppressWarnings("deprecation")
45+
@Import(CassandraDriverConfiguration.class)
4846
public class CassandraHealthContributorAutoConfiguration {
4947

5048
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cassandra/CassandraHealthContributorConfigurations.java

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -27,12 +27,9 @@
2727
import org.springframework.boot.actuate.health.HealthContributor;
2828
import org.springframework.boot.actuate.health.ReactiveHealthContributor;
2929
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
30-
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
3130
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
3231
import org.springframework.context.annotation.Bean;
3332
import org.springframework.context.annotation.Configuration;
34-
import org.springframework.data.cassandra.core.CassandraOperations;
35-
import org.springframework.data.cassandra.core.ReactiveCassandraOperations;
3633

3734
/**
3835
* Health contributor options for Cassandra.
@@ -54,21 +51,6 @@ HealthContributor cassandraHealthContributor(Map<String, CqlSession> sessions) {
5451

5552
}
5653

57-
@Configuration(proxyBeanMethods = false)
58-
@ConditionalOnClass(CassandraOperations.class)
59-
@ConditionalOnBean(CassandraOperations.class)
60-
@Deprecated
61-
static class CassandraOperationsConfiguration extends
62-
CompositeHealthContributorConfiguration<org.springframework.boot.actuate.cassandra.CassandraHealthIndicator, CassandraOperations> {
63-
64-
@Bean
65-
@ConditionalOnMissingBean(name = { "cassandraHealthIndicator", "cassandraHealthContributor" })
66-
HealthContributor cassandraHealthContributor(Map<String, CassandraOperations> cassandraOperations) {
67-
return createContributor(cassandraOperations);
68-
}
69-
70-
}
71-
7254
@Configuration(proxyBeanMethods = false)
7355
@ConditionalOnBean(CqlSession.class)
7456
static class CassandraReactiveDriverConfiguration extends
@@ -82,20 +64,4 @@ ReactiveHealthContributor cassandraHealthContributor(Map<String, CqlSession> ses
8264

8365
}
8466

85-
@Configuration(proxyBeanMethods = false)
86-
@ConditionalOnClass(ReactiveCassandraOperations.class)
87-
@ConditionalOnBean(ReactiveCassandraOperations.class)
88-
@Deprecated
89-
static class CassandraReactiveOperationsConfiguration extends
90-
CompositeReactiveHealthContributorConfiguration<org.springframework.boot.actuate.cassandra.CassandraReactiveHealthIndicator, ReactiveCassandraOperations> {
91-
92-
@Bean
93-
@ConditionalOnMissingBean(name = { "cassandraHealthIndicator", "cassandraHealthContributor" })
94-
ReactiveHealthContributor cassandraHealthContributor(
95-
Map<String, ReactiveCassandraOperations> reactiveCassandraOperations) {
96-
return createContributor(reactiveCassandraOperations);
97-
}
98-
99-
}
100-
10167
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cassandra/CassandraReactiveHealthContributorAutoConfiguration.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -41,9 +41,7 @@
4141
@ConditionalOnClass({ CqlSession.class, Flux.class })
4242
@ConditionalOnEnabledHealthIndicator("cassandra")
4343
@AutoConfigureAfter(CassandraReactiveDataAutoConfiguration.class)
44-
@Import({ CassandraReactiveDriverConfiguration.class,
45-
CassandraHealthContributorConfigurations.CassandraReactiveOperationsConfiguration.class })
46-
@SuppressWarnings("deprecation")
44+
@Import(CassandraReactiveDriverConfiguration.class)
4745
public class CassandraReactiveHealthContributorAutoConfiguration {
4846

4947
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,8 @@
2020

2121
import org.springframework.boot.autoconfigure.web.ServerProperties;
2222
import org.springframework.boot.context.properties.ConfigurationProperties;
23-
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
2423
import org.springframework.boot.context.properties.NestedConfigurationProperty;
2524
import org.springframework.boot.web.server.Ssl;
26-
import org.springframework.util.Assert;
2725
import org.springframework.util.StringUtils;
2826

2927
/**
@@ -56,8 +54,6 @@ public class ManagementServerProperties {
5654
*/
5755
private String basePath = "";
5856

59-
private final Servlet servlet = new Servlet();
60-
6157
@NestedConfigurationProperty
6258
private Ssl ssl;
6359

@@ -105,10 +101,6 @@ public void setSsl(Ssl ssl) {
105101
this.ssl = ssl;
106102
}
107103

108-
public Servlet getServlet() {
109-
return this.servlet;
110-
}
111-
112104
private String cleanBasePath(String basePath) {
113105
String candidate = StringUtils.trimWhitespace(basePath);
114106
if (StringUtils.hasText(candidate)) {
@@ -122,49 +114,4 @@ private String cleanBasePath(String basePath) {
122114
return candidate;
123115
}
124116

125-
/**
126-
* Servlet properties.
127-
*/
128-
public static class Servlet {
129-
130-
/**
131-
* Management endpoint context-path (for instance, `/management`). Requires a
132-
* custom management.server.port.
133-
*/
134-
private String contextPath = "";
135-
136-
/**
137-
* Return the context path with no trailing slash (i.e. the '/' root context is
138-
* represented as the empty string).
139-
* @return the context path (no trailing slash)
140-
* @deprecated since 2.4.0 for removal in 2.6.0 in favor of
141-
* {@link ManagementServerProperties#getBasePath()}
142-
*/
143-
@Deprecated
144-
@DeprecatedConfigurationProperty(replacement = "management.server.base-path")
145-
public String getContextPath() {
146-
return this.contextPath;
147-
}
148-
149-
/**
150-
* Set the context path.
151-
* @param contextPath the context path
152-
* @deprecated since 2.4.0 for removal in 2.6.0 in favor of
153-
* {@link ManagementServerProperties#setBasePath(String)}
154-
*/
155-
@Deprecated
156-
public void setContextPath(String contextPath) {
157-
Assert.notNull(contextPath, "ContextPath must not be null");
158-
this.contextPath = cleanContextPath(contextPath);
159-
}
160-
161-
private String cleanContextPath(String contextPath) {
162-
if (StringUtils.hasText(contextPath) && contextPath.endsWith("/")) {
163-
return contextPath.substring(0, contextPath.length() - 1);
164-
}
165-
return contextPath;
166-
}
167-
168-
}
169-
170117
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementChildContextConfiguration.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -126,10 +126,9 @@ protected void customize(ConfigurableServletWebServerFactory webServerFactory,
126126
webServerFactory.setContextPath(getContextPath(managementServerProperties));
127127
}
128128

129-
@SuppressWarnings("deprecation")
130129
private String getContextPath(ManagementServerProperties managementServerProperties) {
131130
String basePath = managementServerProperties.getBasePath();
132-
return StringUtils.hasText(basePath) ? basePath : managementServerProperties.getServlet().getContextPath();
131+
return StringUtils.hasText(basePath) ? basePath : "";
133132
}
134133

135134
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cassandra/CassandraHealthContributorAutoConfigurationTests.java

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -35,7 +35,6 @@
3535
* @author Phillip Webb
3636
* @author Stephane Nicoll
3737
*/
38-
@SuppressWarnings("deprecation")
3938
class CassandraHealthContributorAutoConfigurationTests {
4039

4140
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
@@ -45,39 +44,20 @@ class CassandraHealthContributorAutoConfigurationTests {
4544
@Test
4645
void runWithoutCqlSessionOrCassandraOperationsShouldNotCreateIndicator() {
4746
this.contextRunner.run((context) -> assertThat(context).doesNotHaveBean("cassandraHealthContributor")
48-
.doesNotHaveBean(org.springframework.boot.actuate.cassandra.CassandraHealthIndicator.class)
4947
.doesNotHaveBean(CassandraDriverHealthIndicator.class));
5048
}
5149

5250
@Test
5351
void runWithCqlSessionOnlyShouldCreateDriverIndicator() {
5452
this.contextRunner.withBean(CqlSession.class, () -> mock(CqlSession.class))
55-
.run((context) -> assertThat(context).hasSingleBean(CassandraDriverHealthIndicator.class)
56-
.doesNotHaveBean(org.springframework.boot.actuate.cassandra.CassandraHealthIndicator.class));
57-
}
58-
59-
@Test
60-
void runWithCassandraOperationsOnlyShouldCreateRegularIndicator() {
61-
this.contextRunner.withBean(CassandraOperations.class, () -> mock(CassandraOperations.class))
62-
.run((context) -> assertThat(context)
63-
.hasSingleBean(org.springframework.boot.actuate.cassandra.CassandraHealthIndicator.class)
64-
.doesNotHaveBean(CassandraDriverHealthIndicator.class));
65-
}
66-
67-
@Test
68-
void runWithCqlSessionAndCassandraOperationsShouldCreateDriverIndicator() {
69-
this.contextRunner.withBean(CqlSession.class, () -> mock(CqlSession.class))
70-
.withBean(CassandraOperations.class, () -> mock(CassandraOperations.class))
71-
.run((context) -> assertThat(context).hasSingleBean(CassandraDriverHealthIndicator.class)
72-
.doesNotHaveBean(org.springframework.boot.actuate.cassandra.CassandraHealthIndicator.class));
53+
.run((context) -> assertThat(context).hasSingleBean(CassandraDriverHealthIndicator.class));
7354
}
7455

7556
@Test
7657
void runWithCqlSessionAndSpringDataAbsentShouldCreateDriverIndicator() {
7758
this.contextRunner.withBean(CqlSession.class, () -> mock(CqlSession.class))
7859
.withClassLoader(new FilteredClassLoader("org.springframework.data"))
79-
.run((context) -> assertThat(context).hasSingleBean(CassandraDriverHealthIndicator.class)
80-
.doesNotHaveBean(org.springframework.boot.actuate.cassandra.CassandraHealthIndicator.class));
60+
.run((context) -> assertThat(context).hasSingleBean(CassandraDriverHealthIndicator.class));
8161
}
8262

8363
@Test
@@ -86,7 +66,6 @@ void runWhenDisabledShouldNotCreateIndicator() {
8666
.withBean(CassandraOperations.class, () -> mock(CassandraOperations.class))
8767
.withPropertyValues("management.health.cassandra.enabled:false")
8868
.run((context) -> assertThat(context).doesNotHaveBean("cassandraHealthContributor")
89-
.doesNotHaveBean(org.springframework.boot.actuate.cassandra.CassandraHealthIndicator.class)
9069
.doesNotHaveBean(CassandraDriverHealthIndicator.class));
9170
}
9271

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cassandra/CassandraReactiveHealthContributorAutoConfigurationTests.java

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -37,7 +37,6 @@
3737
* @author Artsiom Yudovin
3838
* @author Stephane Nicoll
3939
*/
40-
@SuppressWarnings("deprecation")
4140
class CassandraReactiveHealthContributorAutoConfigurationTests {
4241

4342
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
@@ -47,28 +46,13 @@ class CassandraReactiveHealthContributorAutoConfigurationTests {
4746
@Test
4847
void runWithoutCqlSessionOrReactiveCassandraOperationsShouldNotCreateIndicator() {
4948
this.contextRunner.run((context) -> assertThat(context).doesNotHaveBean("cassandraHealthContributor")
50-
.doesNotHaveBean(org.springframework.boot.actuate.cassandra.CassandraReactiveHealthIndicator.class)
5149
.doesNotHaveBean(CassandraDriverReactiveHealthIndicator.class));
5250
}
5351

5452
@Test
5553
void runWithCqlSessionOnlyShouldCreateDriverIndicator() {
56-
this.contextRunner.withBean(CqlSession.class, () -> mock(CqlSession.class))
57-
.run((context) -> assertThat(context).hasBean("cassandraHealthContributor")
58-
.hasSingleBean(CassandraDriverReactiveHealthIndicator.class).doesNotHaveBean(
59-
org.springframework.boot.actuate.cassandra.CassandraReactiveHealthIndicator.class));
60-
}
61-
62-
@Test
63-
void runWithReactiveCassandraOperationsOnlyShouldCreateReactiveIndicator() {
64-
this.contextRunner.withBean(ReactiveCassandraOperations.class, () -> mock(ReactiveCassandraOperations.class))
65-
.withBean(CassandraOperations.class, () -> mock(CassandraOperations.class))
66-
.run((context) -> assertThat(context).hasBean("cassandraHealthContributor")
67-
.hasSingleBean(
68-
org.springframework.boot.actuate.cassandra.CassandraReactiveHealthIndicator.class)
69-
.doesNotHaveBean(CassandraDriverReactiveHealthIndicator.class)
70-
.doesNotHaveBean(org.springframework.boot.actuate.cassandra.CassandraHealthIndicator.class)
71-
.doesNotHaveBean(CassandraDriverHealthIndicator.class));
54+
this.contextRunner.withBean(CqlSession.class, () -> mock(CqlSession.class)).run((context) -> assertThat(context)
55+
.hasBean("cassandraHealthContributor").hasSingleBean(CassandraDriverReactiveHealthIndicator.class));
7256
}
7357

7458
@Test
@@ -78,9 +62,6 @@ void runWithCqlSessionAndReactiveCassandraOperationsShouldCreateDriverIndicator(
7862
.withBean(CassandraOperations.class, () -> mock(CassandraOperations.class))
7963
.run((context) -> assertThat(context).hasBean("cassandraHealthContributor")
8064
.hasSingleBean(CassandraDriverReactiveHealthIndicator.class)
81-
.doesNotHaveBean(
82-
org.springframework.boot.actuate.cassandra.CassandraReactiveHealthIndicator.class)
83-
.doesNotHaveBean(org.springframework.boot.actuate.cassandra.CassandraHealthIndicator.class)
8465
.doesNotHaveBean(CassandraDriverHealthIndicator.class));
8566
}
8667

@@ -89,17 +70,15 @@ void runWithCqlSessionAndSpringDataAbsentShouldCreateDriverIndicator() {
8970
this.contextRunner.withBean(CqlSession.class, () -> mock(CqlSession.class))
9071
.withClassLoader(new FilteredClassLoader("org.springframework.data"))
9172
.run((context) -> assertThat(context).hasBean("cassandraHealthContributor")
92-
.hasSingleBean(CassandraDriverReactiveHealthIndicator.class).doesNotHaveBean(
93-
org.springframework.boot.actuate.cassandra.CassandraReactiveHealthIndicator.class));
73+
.hasSingleBean(CassandraDriverReactiveHealthIndicator.class));
9474
}
9575

9676
@Test
9777
void runWhenDisabledShouldNotCreateIndicator() {
9878
this.contextRunner.withBean(CqlSession.class, () -> mock(CqlSession.class))
9979
.withBean(ReactiveCassandraOperations.class, () -> mock(ReactiveCassandraOperations.class))
10080
.withPropertyValues("management.health.cassandra.enabled:false")
101-
.run((context) -> assertThat(context).doesNotHaveBean("cassandraHealthContributor").doesNotHaveBean(
102-
org.springframework.boot.actuate.cassandra.CassandraReactiveHealthIndicator.class));
81+
.run((context) -> assertThat(context).doesNotHaveBean("cassandraHealthContributor"));
10382
}
10483

10584
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/ConfigurationPropertiesReportEndpointDocumentationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void configProps() throws Exception {
5959

6060
@Test
6161
void configPropsFilterByPrefix() throws Exception {
62-
this.mockMvc.perform(get("/actuator/configprops/spring.resources")).andExpect(status().isOk())
62+
this.mockMvc.perform(get("/actuator/configprops/spring.jackson")).andExpect(status().isOk())
6363
.andDo(MockMvcRestDocumentation.document("configprops/prefixed",
6464
preprocessResponse(limit("contexts", getApplicationContext().getId(), "beans")),
6565
responseFields(fieldWithPath("contexts").description("Application contexts keyed by id."),

0 commit comments

Comments
 (0)