diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/condition/ConditionalOnAvailableEndpoint.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/condition/ConditionalOnAvailableEndpoint.java
index 0e83b125aa..5b4374f48e 100644
--- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/condition/ConditionalOnAvailableEndpoint.java
+++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/condition/ConditionalOnAvailableEndpoint.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2024 the original author or authors.
+ * Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,9 +34,9 @@ import org.springframework.core.env.Environment;
* endpoint is considered available if it is both enabled and exposed on the specified
* technologies.
*
- * Matches enablement according to the endpoints specific {@link Environment} property,
- * falling back to {@code management.endpoints.enabled-by-default} or failing that
- * {@link Endpoint#enableByDefault()}.
+ * Matches access according to the endpoint's specific {@link Environment} property,
+ * falling back to {@code management.endpoints.default-access} or failing that
+ * {@link Endpoint#defaultAccess()}.
*
* Matches exposure according to any of the {@code management.endpoints.web.exposure.}
* or {@code management.endpoints.jmx.exposure.} specific properties or failing that
diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/condition/OnAvailableEndpointCondition.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/condition/OnAvailableEndpointCondition.java
index 5659f895d9..817eef2c4d 100644
--- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/condition/OnAvailableEndpointCondition.java
+++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/condition/OnAvailableEndpointCondition.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2024 the original author or authors.
+ * Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,7 +17,6 @@
package org.springframework.boot.actuate.autoconfigure.endpoint.condition;
import java.util.Arrays;
-import java.util.Collection;
import java.util.EnumSet;
import java.util.LinkedHashSet;
import java.util.List;
@@ -126,8 +125,7 @@ class OnAvailableEndpointCondition extends SpringBootCondition {
private ConditionOutcome getAccessOutcome(Environment environment, MergedAnnotation endpointAnnotation,
EndpointId endpointId, ConditionMessage.Builder message) {
Access defaultAccess = endpointAnnotation.getEnum("defaultAccess", Access.class);
- boolean enableByDefault = endpointAnnotation.getBoolean("enableByDefault");
- Access access = getAccess(environment, endpointId, (enableByDefault) ? defaultAccess : Access.NONE);
+ Access access = getAccess(environment, endpointId, defaultAccess);
return new ConditionOutcome(access != Access.NONE,
message.because("the configured access for endpoint '%s' is %s".formatted(endpointId, access)));
}
@@ -153,17 +151,8 @@ class OnAvailableEndpointCondition extends SpringBootCondition {
private Set getExposures(MergedAnnotation conditionAnnotation) {
EndpointExposure[] exposures = conditionAnnotation.getEnumArray("exposure", EndpointExposure.class);
- return replaceCloudFoundryExposure(
- (exposures.length == 0) ? EnumSet.allOf(EndpointExposure.class) : Arrays.asList(exposures));
- }
-
- @SuppressWarnings("removal")
- private Set replaceCloudFoundryExposure(Collection exposures) {
- Set result = EnumSet.copyOf(exposures);
- if (result.remove(EndpointExposure.CLOUD_FOUNDRY)) {
- result.add(EndpointExposure.WEB);
- }
- return result;
+ return (exposures.length == 0) ? EnumSet.allOf(EndpointExposure.class)
+ : EnumSet.copyOf(Arrays.asList(exposures));
}
private Set getExposureOutcomeContributors(ConditionContext context) {
diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/EndpointExposure.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/EndpointExposure.java
index 5d5bd55d41..a008680c4a 100644
--- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/EndpointExposure.java
+++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/EndpointExposure.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2024 the original author or authors.
+ * Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,16 +32,7 @@ public enum EndpointExposure {
/**
* Exposed over a web endpoint.
*/
- WEB("health"),
-
- /**
- * Exposed on Cloud Foundry over `/cloudfoundryapplication`.
- * @since 2.6.4
- * @deprecated since 3.4.0 for removal in 4.0.0 in favor of using
- * {@link EndpointExposure#WEB}
- */
- @Deprecated(since = "3.4.0", forRemoval = true)
- CLOUD_FOUNDRY("*");
+ WEB("health");
private final String[] defaultIncludes;
diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementWebServerFactoryCustomizer.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementWebServerFactoryCustomizer.java
index c42b9cf575..6b868ff46f 100644
--- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementWebServerFactoryCustomizer.java
+++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementWebServerFactoryCustomizer.java
@@ -46,15 +46,6 @@ public class ManagementWebServerFactoryCustomizer>[] customizerClasses;
- @SafeVarargs
- @SuppressWarnings("varargs")
- @Deprecated(since = "3.5.0", forRemoval = true)
- protected ManagementWebServerFactoryCustomizer(ListableBeanFactory beanFactory,
- Class extends WebServerFactoryCustomizer>>... customizerClasses) {
- this.beanFactory = beanFactory;
- this.customizerClasses = customizerClasses;
- }
-
/**
* Creates a new customizer that will retrieve beans using the given
* {@code beanFactory}.
diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/condition/ConditionalOnAvailableEndpointTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/condition/ConditionalOnAvailableEndpointTests.java
index 09b63a9824..efb0b44ff9 100644
--- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/condition/ConditionalOnAvailableEndpointTests.java
+++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/condition/ConditionalOnAvailableEndpointTests.java
@@ -273,21 +273,6 @@ class ConditionalOnAvailableEndpointTests {
.isInstanceOf(MutuallyExclusiveConfigurationPropertiesException.class));
}
- @Test
- void whenDisabledAndAccessibleByDefaultEndpointIsNotAvailable() {
- this.contextRunner.withUserConfiguration(DisabledButAccessibleEndpointConfiguration.class)
- .withPropertyValues("management.endpoints.web.exposure.include=*")
- .run((context) -> assertThat(context).doesNotHaveBean(DisabledButAccessibleEndpoint.class));
- }
-
- @Test
- void whenDisabledAndAccessibleByDefaultEndpointCanBeAvailable() {
- this.contextRunner.withUserConfiguration(DisabledButAccessibleEndpointConfiguration.class)
- .withPropertyValues("management.endpoints.web.exposure.include=*",
- "management.endpoints.access.default=unrestricted")
- .run((context) -> assertThat(context).hasSingleBean(DisabledButAccessibleEndpoint.class));
- }
-
@Test
@WithTestEndpointOutcomeExposureContributor
void exposureOutcomeContributorCanMakeEndpointAvailable() {
@@ -325,12 +310,6 @@ class ConditionalOnAvailableEndpointTests {
}
- @SuppressWarnings({ "deprecation", "removal" })
- @Endpoint(id = "disabledbutaccessible", enableByDefault = false)
- static class DisabledButAccessibleEndpoint {
-
- }
-
@EndpointExtension(endpoint = SpringEndpoint.class, filter = TestFilter.class)
static class SpringEndpointExtension {
@@ -430,15 +409,4 @@ class ConditionalOnAvailableEndpointTests {
}
- @Configuration(proxyBeanMethods = false)
- static class DisabledButAccessibleEndpointConfiguration {
-
- @Bean
- @ConditionalOnAvailableEndpoint
- DisabledButAccessibleEndpoint disabledButAccessible() {
- return new DisabledButAccessibleEndpoint();
- }
-
- }
-
}
diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/AbstractExposableEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/AbstractExposableEndpoint.java
index ab4f2fdefc..4cbbe08b3e 100644
--- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/AbstractExposableEndpoint.java
+++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/AbstractExposableEndpoint.java
@@ -36,19 +36,6 @@ public abstract class AbstractExposableEndpoint implements
private final List operations;
- /**
- * Create a new {@link AbstractExposableEndpoint} instance.
- * @param id the endpoint id
- * @param enabledByDefault if the endpoint is enabled by default
- * @param operations the endpoint operations
- * @deprecated since 3.4.0 for removal in 4.0.0 in favor of
- * {@link #AbstractExposableEndpoint(EndpointId, Access, Collection)}
- */
- @Deprecated(since = "3.4.0", forRemoval = true)
- public AbstractExposableEndpoint(EndpointId id, boolean enabledByDefault, Collection extends O> operations) {
- this(id, (enabledByDefault) ? Access.UNRESTRICTED : Access.READ_ONLY, operations);
- }
-
/**
* Create a new {@link AbstractExposableEndpoint} instance.
* @param id the endpoint id
@@ -69,13 +56,6 @@ public abstract class AbstractExposableEndpoint implements
return this.id;
}
- @Override
- @SuppressWarnings("removal")
- @Deprecated(since = "3.4.0", forRemoval = true)
- public boolean isEnableByDefault() {
- return this.defaultAccess != Access.NONE;
- }
-
@Override
public Access getDefaultAccess() {
return this.defaultAccess;
diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/ExposableEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/ExposableEndpoint.java
index 34f8dc6d95..5f5718b1e5 100644
--- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/ExposableEndpoint.java
+++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/ExposableEndpoint.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2024 the original author or authors.
+ * Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,15 +34,6 @@ public interface ExposableEndpoint {
*/
EndpointId getEndpointId();
- /**
- * Returns if the endpoint is enabled by default.
- * @return if the endpoint is enabled by default
- * @deprecated since 3.4.0 for removal in 4.0.0 in favor of
- * {@link #getDefaultAccess()}
- */
- @Deprecated(since = "3.4.0", forRemoval = true)
- boolean isEnableByDefault();
-
/**
* Returns the access to the endpoint that is permitted by default.
* @return access that is permitted by default
diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/AbstractDiscoveredEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/AbstractDiscoveredEndpoint.java
index 95512c1b26..9e5d17210c 100644
--- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/AbstractDiscoveredEndpoint.java
+++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/AbstractDiscoveredEndpoint.java
@@ -41,23 +41,6 @@ public abstract class AbstractDiscoveredEndpoint extends Ab
private final Object endpointBean;
- /**
- * Create a new {@link AbstractDiscoveredEndpoint} instance.
- * @param discoverer the discoverer that discovered the endpoint
- * @param endpointBean the primary source bean
- * @param id the ID of the endpoint
- * @param enabledByDefault if the endpoint is enabled by default
- * @param operations the endpoint operations
- * @deprecated since 3.4.0 for removal in 4.0.0 in favor of
- * {@link #AbstractDiscoveredEndpoint(EndpointDiscoverer, Object, EndpointId, Access, Collection)}
- */
- @SuppressWarnings("removal")
- @Deprecated(since = "3.4.0", forRemoval = true)
- public AbstractDiscoveredEndpoint(EndpointDiscoverer, ?> discoverer, Object endpointBean, EndpointId id,
- boolean enabledByDefault, Collection extends O> operations) {
- this(discoverer, endpointBean, id, (enabledByDefault) ? Access.UNRESTRICTED : Access.READ_ONLY, operations);
- }
-
/**
* Create a new {@link AbstractDiscoveredEndpoint} instance.
* @param discoverer the discoverer that discovered the endpoint
diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/Endpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/Endpoint.java
index d52fee56bf..6699cf3257 100644
--- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/Endpoint.java
+++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/Endpoint.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2024 the original author or authors.
+ * Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -63,14 +63,6 @@ public @interface Endpoint {
*/
String id() default "";
- /**
- * If the endpoint should be enabled or disabled by default.
- * @return {@code true} if the endpoint is enabled by default
- * @deprecated since 3.4.0 for removal in 4.0.0 in favor of {@link #defaultAccess()}
- */
- @Deprecated(since = "3.4.0", forRemoval = true)
- boolean enableByDefault() default true;
-
/**
* Level of access to the endpoint that is permitted by default.
* @return the default level of access
diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/EndpointDiscoverer.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/EndpointDiscoverer.java
index 09b12e99d9..1fe6db636f 100644
--- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/EndpointDiscoverer.java
+++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/EndpointDiscoverer.java
@@ -84,21 +84,6 @@ public abstract class EndpointDiscoverer, O exten
private volatile Collection endpoints;
- /**
- * Create a new {@link EndpointDiscoverer} instance.
- * @param applicationContext the source application context
- * @param parameterValueMapper the parameter value mapper
- * @param invokerAdvisors invoker advisors to apply
- * @param endpointFilters endpoint filters to apply
- * @deprecated since 3.4.0 for removal in 4.0.0 in favor of
- * {@link #EndpointDiscoverer(ApplicationContext, ParameterValueMapper, Collection, Collection, Collection)}
- */
- @Deprecated(since = "3.4.0", forRemoval = true)
- public EndpointDiscoverer(ApplicationContext applicationContext, ParameterValueMapper parameterValueMapper,
- Collection invokerAdvisors, Collection> endpointFilters) {
- this(applicationContext, parameterValueMapper, invokerAdvisors, endpointFilters, Collections.emptyList());
- }
-
/**
* Create a new {@link EndpointDiscoverer} instance.
* @param applicationContext the source application context
@@ -381,21 +366,6 @@ public abstract class EndpointDiscoverer, O exten
return (Class extends E>) ResolvableType.forClass(EndpointDiscoverer.class, getClass()).resolveGeneric(0);
}
- /**
- * Factory method called to create the {@link ExposableEndpoint endpoint}.
- * @param endpointBean the source endpoint bean
- * @param id the ID of the endpoint
- * @param enabledByDefault if the endpoint is enabled by default
- * @param operations the endpoint operations
- * @return a created endpoint (a {@link DiscoveredEndpoint} is recommended)
- * @deprecated since 3.4.0 for removal in 4.0.0 in favor of
- * {@link #createEndpoint(Object, EndpointId, Access, Collection)}
- */
- @Deprecated(since = "3.4.0", forRemoval = true)
- protected E createEndpoint(Object endpointBean, EndpointId id, boolean enabledByDefault, Collection operations) {
- return createEndpoint(endpointBean, id, (enabledByDefault) ? Access.UNRESTRICTED : Access.NONE, operations);
- }
-
/**
* Factory method called to create the {@link ExposableEndpoint endpoint}.
* @param endpointBean the source endpoint bean
@@ -498,8 +468,7 @@ public abstract class EndpointDiscoverer, O exten
this.beanType = beanType;
this.beanSupplier = beanSupplier;
this.id = EndpointId.of(environment, id);
- boolean enabledByDefault = annotation.getBoolean("enableByDefault");
- this.defaultAccess = enabledByDefault ? annotation.getEnum("defaultAccess", Access.class) : Access.NONE;
+ this.defaultAccess = annotation.getEnum("defaultAccess", Access.class);
this.filter = getFilter(beanType);
}
diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethod.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethod.java
index 795f39ae81..d091ac7f0b 100644
--- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethod.java
+++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethod.java
@@ -49,7 +49,7 @@ public class OperationMethod {
* @param method the source method
* @param operationType the operation type
* @deprecated since 4.0.0 for removal in 4.2.0 in favor of
- * {@link #OperationMethod(Method, OperationType, Predicate)}p
+ * {@link #OperationMethod(Method, OperationType, Predicate)}
*/
@Deprecated(since = "4.0.0", forRemoval = true)
public OperationMethod(Method method, OperationType operationType) {
diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/annotation/JmxEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/annotation/JmxEndpoint.java
index 02916b5cdb..2e27ab17f8 100644
--- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/annotation/JmxEndpoint.java
+++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/annotation/JmxEndpoint.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2024 the original author or authors.
+ * Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -48,15 +48,6 @@ public @interface JmxEndpoint {
@AliasFor(annotation = Endpoint.class)
String id() default "";
- /**
- * If the endpoint should be enabled or disabled by default.
- * @return {@code true} if the endpoint is enabled by default
- * @deprecated since 3.4.0 for removal in 4.0.0 in favor of
- */
- @Deprecated(since = "3.4.0", forRemoval = true)
- @AliasFor(annotation = Endpoint.class)
- boolean enableByDefault() default true;
-
/**
* Level of access to the endpoint that is permitted by default.
* @return the default level of access
diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/annotation/JmxEndpointDiscoverer.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/annotation/JmxEndpointDiscoverer.java
index d9f235def8..f062859666 100644
--- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/annotation/JmxEndpointDiscoverer.java
+++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/annotation/JmxEndpointDiscoverer.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2024 the original author or authors.
+ * Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,7 +17,6 @@
package org.springframework.boot.actuate.endpoint.jmx.annotation;
import java.util.Collection;
-import java.util.Collections;
import org.springframework.aot.hint.MemberCategory;
import org.springframework.aot.hint.RuntimeHints;
@@ -48,22 +47,6 @@ import org.springframework.context.annotation.ImportRuntimeHints;
public class JmxEndpointDiscoverer extends EndpointDiscoverer
implements JmxEndpointsSupplier {
- /**
- * Create a new {@link JmxEndpointDiscoverer} instance.
- * @param applicationContext the source application context
- * @param parameterValueMapper the parameter value mapper
- * @param invokerAdvisors invoker advisors to apply
- * @param endpointFilters endpoint filters to apply
- * @deprecated since 3.4.0 for removal in 4.0.0 in favor of
- * {@link #JmxEndpointDiscoverer(ApplicationContext, ParameterValueMapper, Collection, Collection, Collection)}
- */
- @Deprecated(since = "3.4.0", forRemoval = true)
- public JmxEndpointDiscoverer(ApplicationContext applicationContext, ParameterValueMapper parameterValueMapper,
- Collection invokerAdvisors,
- Collection> endpointFilters) {
- this(applicationContext, parameterValueMapper, invokerAdvisors, endpointFilters, Collections.emptyList());
- }
-
/**
* Create a new {@link JmxEndpointDiscoverer} instance.
* @param applicationContext the source application context
diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ControllerEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ControllerEndpoint.java
index 02aed521ae..da0c3f0927 100644
--- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ControllerEndpoint.java
+++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ControllerEndpoint.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2024 the original author or authors.
+ * Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -65,13 +65,6 @@ public @interface ControllerEndpoint {
@AliasFor(annotation = Endpoint.class)
String id();
- /**
- * If the endpoint should be enabled or disabled by default.
- * @return {@code true} if the endpoint is enabled by default
- */
- @AliasFor(annotation = Endpoint.class)
- boolean enableByDefault() default true;
-
/**
* Level of access to the endpoint that is permitted by default.
* @return the default level of access
diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/RestControllerEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/RestControllerEndpoint.java
index 549f8e1a58..24d7419750 100644
--- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/RestControllerEndpoint.java
+++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/RestControllerEndpoint.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2024 the original author or authors.
+ * Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -67,13 +67,6 @@ public @interface RestControllerEndpoint {
@AliasFor(annotation = Endpoint.class)
String id();
- /**
- * If the endpoint should be enabled or disabled by default.
- * @return {@code true} if the endpoint is enabled by default
- */
- @AliasFor(annotation = Endpoint.class)
- boolean enableByDefault() default true;
-
/**
* Level of access to the endpoint that is permitted by default.
* @return the default level of access
diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ServletEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ServletEndpoint.java
index ca1480015c..13e6334138 100644
--- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ServletEndpoint.java
+++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ServletEndpoint.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2024 the original author or authors.
+ * Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -58,13 +58,6 @@ public @interface ServletEndpoint {
@AliasFor(annotation = Endpoint.class)
String id();
- /**
- * If the endpoint should be enabled or disabled by default.
- * @return {@code true} if the endpoint is enabled by default
- */
- @AliasFor(annotation = Endpoint.class)
- boolean enableByDefault() default true;
-
/**
* Level of access to the endpoint that is permitted by default.
* @return the default level of access
diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/WebEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/WebEndpoint.java
index eb0f48ca6e..526635d1ce 100644
--- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/WebEndpoint.java
+++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/WebEndpoint.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2024 the original author or authors.
+ * Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -48,15 +48,6 @@ public @interface WebEndpoint {
@AliasFor(annotation = Endpoint.class)
String id();
- /**
- * If the endpoint should be enabled or disabled by default.
- * @return {@code true} if the endpoint is enabled by default
- * @deprecated since 3.4.0 for removal in 4.0.0 in favor of {@link #defaultAccess()}
- */
- @Deprecated(since = "3.4.0", forRemoval = true)
- @AliasFor(annotation = Endpoint.class)
- boolean enableByDefault() default true;
-
/**
* Level of access to the endpoint that is permitted by default.
* @return the default level of access
diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/WebEndpointDiscoverer.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/WebEndpointDiscoverer.java
index d984a3854f..6dae0a7863 100644
--- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/WebEndpointDiscoverer.java
+++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/WebEndpointDiscoverer.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2024 the original author or authors.
+ * Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -59,26 +59,6 @@ public class WebEndpointDiscoverer extends EndpointDiscoverer endpointPathMappers,
- Collection invokerAdvisors,
- Collection> filters) {
- this(applicationContext, parameterValueMapper, endpointMediaTypes, endpointPathMappers, Collections.emptyList(),
- invokerAdvisors, filters, Collections.emptyList());
- }
-
/**
* Create a new {@link WebEndpointDiscoverer} instance.
* @param applicationContext the source application context
diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/annotation/EndpointDiscovererTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/annotation/EndpointDiscovererTests.java
index 2c3dc531f4..9b53eecb89 100644
--- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/annotation/EndpointDiscovererTests.java
+++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/annotation/EndpointDiscovererTests.java
@@ -562,13 +562,6 @@ class EndpointDiscovererTests {
return new TestExposableEndpoint(this, endpointBean, id, defaultAccess, operations);
}
- @Override
- @SuppressWarnings("removal")
- protected TestExposableEndpoint createEndpoint(Object endpointBean, EndpointId id, boolean enabledByDefault,
- Collection operations) {
- return new TestExposableEndpoint(this, endpointBean, id, enabledByDefault, operations);
- }
-
@Override
protected TestOperation createOperation(EndpointId endpointId, DiscoveredOperationMethod operationMethod,
OperationInvoker invoker) {
@@ -603,13 +596,6 @@ class EndpointDiscovererTests {
return new SpecializedExposableEndpoint(this, endpointBean, id, defaultAccess, operations);
}
- @Override
- @SuppressWarnings("removal")
- protected SpecializedExposableEndpoint createEndpoint(Object endpointBean, EndpointId id,
- boolean enabledByDefault, Collection operations) {
- return new SpecializedExposableEndpoint(this, endpointBean, id, enabledByDefault, operations);
- }
-
@Override
protected SpecializedOperation createOperation(EndpointId endpointId, DiscoveredOperationMethod operationMethod,
OperationInvoker invoker) {
@@ -631,12 +617,6 @@ class EndpointDiscovererTests {
super(discoverer, endpointBean, id, defaultAccess, operations);
}
- @SuppressWarnings("removal")
- TestExposableEndpoint(EndpointDiscoverer, ?> discoverer, Object endpointBean, EndpointId id,
- boolean enabledByDefault, Collection extends TestOperation> operations) {
- super(discoverer, endpointBean, id, enabledByDefault, operations);
- }
-
}
static class SpecializedExposableEndpoint extends AbstractDiscoveredEndpoint {
@@ -647,12 +627,6 @@ class EndpointDiscovererTests {
super(discoverer, endpointBean, id, defaultAccess, operations);
}
- @SuppressWarnings("removal")
- SpecializedExposableEndpoint(EndpointDiscoverer, ?> discoverer, Object endpointBean, EndpointId id,
- boolean enabledByDefault, Collection extends SpecializedOperation> operations) {
- super(discoverer, endpointBean, id, enabledByDefault, operations);
- }
-
}
static class TestOperation extends AbstractDiscoveredOperation {
diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/TestExposableJmxEndpoint.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/TestExposableJmxEndpoint.java
index 3d78ebb9c4..9f5970b52b 100644
--- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/TestExposableJmxEndpoint.java
+++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/TestExposableJmxEndpoint.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2024 the original author or authors.
+ * Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -44,12 +44,6 @@ public class TestExposableJmxEndpoint implements ExposableJmxEndpoint {
return EndpointId.of("test");
}
- @Override
- @SuppressWarnings("removal")
- public boolean isEnableByDefault() {
- return true;
- }
-
@Override
public Collection getOperations() {
return this.operations;
diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/EndpointLinksResolverTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/EndpointLinksResolverTests.java
index d48488aef0..2dcbc717a1 100644
--- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/EndpointLinksResolverTests.java
+++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/EndpointLinksResolverTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2024 the original author or authors.
+ * Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -63,7 +63,6 @@ class EndpointLinksResolverTests {
operations.add(operationWithPath("/alpha/{name}", "alpha-name"));
ExposableWebEndpoint endpoint = mock(ExposableWebEndpoint.class);
given(endpoint.getEndpointId()).willReturn(EndpointId.of("alpha"));
- given(endpoint.isEnableByDefault()).willReturn(true);
given(endpoint.getOperations()).willReturn(operations);
String requestUrl = "https://api.example.com/actuator";
Map links = new EndpointLinksResolver(Collections.singletonList(endpoint))
@@ -80,7 +79,6 @@ class EndpointLinksResolverTests {
void resolvedLinksContainsALinkForServletEndpoint() {
ExposableServletEndpoint servletEndpoint = mock(ExposableServletEndpoint.class);
given(servletEndpoint.getEndpointId()).willReturn(EndpointId.of("alpha"));
- given(servletEndpoint.isEnableByDefault()).willReturn(true);
given(servletEndpoint.getRootPath()).willReturn("alpha");
String requestUrl = "https://api.example.com/actuator";
Map links = new EndpointLinksResolver(Collections.singletonList(servletEndpoint))
@@ -94,7 +92,6 @@ class EndpointLinksResolverTests {
void resolvedLinksContainsALinkForControllerEndpoint() {
ExposableControllerEndpoint controllerEndpoint = mock(ExposableControllerEndpoint.class);
given(controllerEndpoint.getEndpointId()).willReturn(EndpointId.of("alpha"));
- given(controllerEndpoint.isEnableByDefault()).willReturn(true);
given(controllerEndpoint.getRootPath()).willReturn("alpha");
String requestUrl = "https://api.example.com/actuator";
Map links = new EndpointLinksResolver(Collections.singletonList(controllerEndpoint))
diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionOutcome.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionOutcome.java
index 4ff371300b..11fe9b9a0a 100644
--- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionOutcome.java
+++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionOutcome.java
@@ -148,17 +148,4 @@ public class ConditionOutcome {
return (this.message != null) ? this.message.toString() : "";
}
- /**
- * Return the inverse of the specified condition outcome.
- * @param outcome the outcome to inverse
- * @return the inverse of the condition outcome
- * @since 1.3.0
- * @deprecated since 3.5.0 for removal in 4.0.0 in favor of
- * {@link #ConditionOutcome(boolean, ConditionMessage)}
- */
- @Deprecated(since = "3.5.0", forRemoval = true)
- public static ConditionOutcome inverse(ConditionOutcome outcome) {
- return new ConditionOutcome(!outcome.isMatch(), outcome.getConditionMessage());
- }
-
}
diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/service/connection/ConnectionDetailsFactories.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/service/connection/ConnectionDetailsFactories.java
index 5ec7c2deff..8bd16bd7c7 100644
--- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/service/connection/ConnectionDetailsFactories.java
+++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/service/connection/ConnectionDetailsFactories.java
@@ -48,16 +48,6 @@ public class ConnectionDetailsFactories {
private final List> registrations = new ArrayList<>();
- /**
- * Create a new {@link ConnectionDetailsFactories} instance.
- * @deprecated since 3.5.0 for removal in 4.0.0 in favor of
- * {@link #ConnectionDetailsFactories(ClassLoader)}
- */
- @Deprecated(since = "3.5.0", forRemoval = true)
- public ConnectionDetailsFactories() {
- this((ClassLoader) null);
- }
-
/**
* Create a new {@link ConnectionDetailsFactories} instance.
* @param classLoader the class loader used to load factories
diff --git a/spring-boot-project/spring-boot-batch/src/main/java/org/springframework/boot/batch/autoconfigure/JobLauncherApplicationRunner.java b/spring-boot-project/spring-boot-batch/src/main/java/org/springframework/boot/batch/autoconfigure/JobLauncherApplicationRunner.java
index d897318e44..05346d61e9 100644
--- a/spring-boot-project/spring-boot-batch/src/main/java/org/springframework/boot/batch/autoconfigure/JobLauncherApplicationRunner.java
+++ b/spring-boot-project/spring-boot-batch/src/main/java/org/springframework/boot/batch/autoconfigure/JobLauncherApplicationRunner.java
@@ -120,11 +120,6 @@ public class JobLauncherApplicationRunner
}
}
- @Deprecated(since = "3.0.10", forRemoval = true)
- public void validate() {
- afterPropertiesSet();
- }
-
public void setOrder(int order) {
this.order = order;
}
diff --git a/spring-boot-project/spring-boot-cassandra/src/dockerTest/java/org/springframework/boot/cassandra/testcontainers/DeprecatedCassandraContainerConnectionDetailsFactoryTests.java b/spring-boot-project/spring-boot-cassandra/src/dockerTest/java/org/springframework/boot/cassandra/testcontainers/DeprecatedCassandraContainerConnectionDetailsFactoryTests.java
deleted file mode 100644
index 4a2910b334..0000000000
--- a/spring-boot-project/spring-boot-cassandra/src/dockerTest/java/org/springframework/boot/cassandra/testcontainers/DeprecatedCassandraContainerConnectionDetailsFactoryTests.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright 2012-2025 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.boot.cassandra.testcontainers;
-
-import com.datastax.oss.driver.api.core.CqlSession;
-import org.junit.jupiter.api.Test;
-import org.testcontainers.containers.CassandraContainer;
-import org.testcontainers.junit.jupiter.Container;
-import org.testcontainers.junit.jupiter.Testcontainers;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
-import org.springframework.boot.cassandra.autoconfigure.CassandraAutoConfiguration;
-import org.springframework.boot.cassandra.autoconfigure.CassandraConnectionDetails;
-import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
-import org.springframework.boot.testsupport.container.TestImage;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-/**
- * Tests for {@link DeprecatedCassandraContainerConnectionDetailsFactory}.
- *
- * @author Andy Wilkinson
- * @deprecated since 3.4.0 for removal in 4.0.0
- */
-@SpringJUnitConfig
-@Testcontainers(disabledWithoutDocker = true)
-@Deprecated(since = "3.4.0", forRemoval = true)
-class DeprecatedCassandraContainerConnectionDetailsFactoryTests {
-
- @Container
- @ServiceConnection
- static final CassandraContainer> cassandra = TestImage.container(CassandraContainer.class);
-
- @Autowired(required = false)
- private CassandraConnectionDetails connectionDetails;
-
- @Autowired
- private CqlSession cqlSession;
-
- @Test
- void connectionCanBeMadeToCassandraContainer() {
- assertThat(this.connectionDetails).isNotNull();
- assertThat(this.cqlSession.getMetadata().getNodes()).hasSize(1);
- }
-
- @Configuration(proxyBeanMethods = false)
- @ImportAutoConfiguration(CassandraAutoConfiguration.class)
- static class TestConfiguration {
-
- }
-
-}
diff --git a/spring-boot-project/spring-boot-cassandra/src/main/java/org/springframework/boot/cassandra/testcontainers/DeprecatedCassandraContainerConnectionDetailsFactory.java b/spring-boot-project/spring-boot-cassandra/src/main/java/org/springframework/boot/cassandra/testcontainers/DeprecatedCassandraContainerConnectionDetailsFactory.java
deleted file mode 100644
index b41a5390cd..0000000000
--- a/spring-boot-project/spring-boot-cassandra/src/main/java/org/springframework/boot/cassandra/testcontainers/DeprecatedCassandraContainerConnectionDetailsFactory.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2012-2025 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.boot.cassandra.testcontainers;
-
-import java.net.InetSocketAddress;
-import java.util.List;
-
-import org.testcontainers.containers.CassandraContainer;
-
-import org.springframework.boot.cassandra.autoconfigure.CassandraConnectionDetails;
-import org.springframework.boot.ssl.SslBundle;
-import org.springframework.boot.testcontainers.service.connection.ContainerConnectionDetailsFactory;
-import org.springframework.boot.testcontainers.service.connection.ContainerConnectionSource;
-import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
-
-/**
- * {@link ContainerConnectionDetailsFactory} to create {@link CassandraConnectionDetails}
- * from a {@link ServiceConnection @ServiceConnection}-annotated
- * {@link CassandraContainer}.
- *
- * @author Moritz Halbritter
- * @author Andy Wilkinson
- * @author Phillip Webb
- * @deprecated since 3.4.0 for removal in 4.0.0 in favor of
- * {@link CassandraContainerConnectionDetailsFactory}.
- */
-@Deprecated(since = "3.4.0", forRemoval = true)
-class DeprecatedCassandraContainerConnectionDetailsFactory
- extends ContainerConnectionDetailsFactory, CassandraConnectionDetails> {
-
- @Override
- protected CassandraConnectionDetails getContainerConnectionDetails(
- ContainerConnectionSource> source) {
- return new CassandraContainerConnectionDetails(source);
- }
-
- /**
- * {@link CassandraConnectionDetails} backed by a {@link ContainerConnectionSource}.
- */
- private static final class CassandraContainerConnectionDetails
- extends ContainerConnectionDetails> implements CassandraConnectionDetails {
-
- private CassandraContainerConnectionDetails(ContainerConnectionSource> source) {
- super(source);
- }
-
- @Override
- public List getContactPoints() {
- InetSocketAddress contactPoint = getContainer().getContactPoint();
- return List.of(new Node(contactPoint.getHostString(), contactPoint.getPort()));
- }
-
- @Override
- public String getUsername() {
- return getContainer().getUsername();
- }
-
- @Override
- public String getPassword() {
- return getContainer().getPassword();
- }
-
- @Override
- public String getLocalDatacenter() {
- return getContainer().getLocalDatacenter();
- }
-
- @Override
- public SslBundle getSslBundle() {
- return super.getSslBundle();
- }
-
- }
-
-}
diff --git a/spring-boot-project/spring-boot-cassandra/src/main/resources/META-INF/spring.factories b/spring-boot-project/spring-boot-cassandra/src/main/resources/META-INF/spring.factories
index a534c7e898..feea7d785d 100644
--- a/spring-boot-project/spring-boot-cassandra/src/main/resources/META-INF/spring.factories
+++ b/spring-boot-project/spring-boot-cassandra/src/main/resources/META-INF/spring.factories
@@ -1,5 +1,4 @@
# Connection Details Factories
org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactory=\
org.springframework.boot.cassandra.docker.compose.CassandraDockerComposeConnectionDetailsFactory,\
-org.springframework.boot.cassandra.testcontainers.CassandraContainerConnectionDetailsFactory,\
-org.springframework.boot.cassandra.testcontainers.DeprecatedCassandraContainerConnectionDetailsFactory
+org.springframework.boot.cassandra.testcontainers.CassandraContainerConnectionDetailsFactory
diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/OnEnabledDevToolsCondition.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/OnEnabledDevToolsCondition.java
index bfa767badc..ad2518da5d 100644
--- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/OnEnabledDevToolsCondition.java
+++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/OnEnabledDevToolsCondition.java
@@ -27,12 +27,8 @@ import org.springframework.core.type.AnnotatedTypeMetadata;
* A condition that checks if DevTools should be enabled.
*
* @author Madhura Bhave
- * @since 2.2.0
- * @deprecated since 3.5.0 for removal in 4.0.0 in favor of
- * {@link ConditionalOnEnabledDevTools @ConditionalOnEnabledDevTools}
*/
-@Deprecated(since = "3.5.0", forRemoval = true)
-public class OnEnabledDevToolsCondition extends SpringBootCondition {
+class OnEnabledDevToolsCondition extends SpringBootCondition {
@Override
public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) {
diff --git a/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayAutoConfiguration.java b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayAutoConfiguration.java
index 747bf4deab..2d610c11be 100644
--- a/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayAutoConfiguration.java
+++ b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayAutoConfiguration.java
@@ -278,8 +278,6 @@ public class FlywayAutoConfiguration {
map.from(properties.isBaselineOnMigrate())
.to((baselineOnMigrate) -> configuration.baselineOnMigrate(baselineOnMigrate));
map.from(properties.isCleanDisabled()).to((cleanDisabled) -> configuration.cleanDisabled(cleanDisabled));
- map.from(properties.isCleanOnValidationError())
- .to((cleanOnValidationError) -> configuration.cleanOnValidationError(cleanOnValidationError));
map.from(properties.isGroup()).to((group) -> configuration.group(group));
map.from(properties.isMixed()).to((mixed) -> configuration.mixed(mixed));
map.from(properties.isOutOfOrder()).to((outOfOrder) -> configuration.outOfOrder(outOfOrder));
diff --git a/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayProperties.java b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayProperties.java
index 3ba5d5273f..c366eb75c6 100644
--- a/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayProperties.java
+++ b/spring-boot-project/spring-boot-flyway/src/main/java/org/springframework/boot/flyway/autoconfigure/FlywayProperties.java
@@ -28,7 +28,6 @@ import java.util.List;
import java.util.Map;
import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
import org.springframework.boot.convert.DurationUnit;
/**
@@ -211,11 +210,6 @@ public class FlywayProperties {
*/
private boolean cleanDisabled = true;
- /**
- * Whether to automatically call clean when a validation error occurs.
- */
- private boolean cleanOnValidationError;
-
/**
* Whether to group all pending migrations together in the same transaction when
* applying them.
@@ -595,17 +589,6 @@ public class FlywayProperties {
this.cleanDisabled = cleanDisabled;
}
- @Deprecated(since = "3.4.0", forRemoval = true)
- @DeprecatedConfigurationProperty(since = "3.4.0", reason = "Deprecated in Flyway 10.18 and removed in Flyway 11.0")
- public boolean isCleanOnValidationError() {
- return this.cleanOnValidationError;
- }
-
- @Deprecated(since = "3.4.0", forRemoval = true)
- public void setCleanOnValidationError(boolean cleanOnValidationError) {
- this.cleanOnValidationError = cleanOnValidationError;
- }
-
public boolean isGroup() {
return this.group;
}
@@ -718,39 +701,6 @@ public class FlywayProperties {
this.errorOverrides = errorOverrides;
}
- @DeprecatedConfigurationProperty(replacement = "spring.flyway.oracle.sqlplus", since = "3.2.0")
- @Deprecated(since = "3.2.0", forRemoval = true)
- public Boolean getOracleSqlplus() {
- return getOracle().getSqlplus();
- }
-
- @Deprecated(since = "3.2.0", forRemoval = true)
- public void setOracleSqlplus(Boolean oracleSqlplus) {
- getOracle().setSqlplus(oracleSqlplus);
- }
-
- @DeprecatedConfigurationProperty(replacement = "spring.flyway.oracle.sqlplus-warn", since = "3.2.0")
- @Deprecated(since = "3.2.0", forRemoval = true)
- public Boolean getOracleSqlplusWarn() {
- return getOracle().getSqlplusWarn();
- }
-
- @Deprecated(since = "3.2.0", forRemoval = true)
- public void setOracleSqlplusWarn(Boolean oracleSqlplusWarn) {
- getOracle().setSqlplusWarn(oracleSqlplusWarn);
- }
-
- @DeprecatedConfigurationProperty(replacement = "spring.flyway.oracle.wallet-location", since = "3.2.0")
- @Deprecated(since = "3.2.0", forRemoval = true)
- public String getOracleWalletLocation() {
- return getOracle().getWalletLocation();
- }
-
- @Deprecated(since = "3.2.0", forRemoval = true)
- public void setOracleWalletLocation(String oracleWalletLocation) {
- getOracle().setWalletLocation(oracleWalletLocation);
- }
-
public Boolean getStream() {
return this.stream;
}
@@ -775,17 +725,6 @@ public class FlywayProperties {
this.kerberosConfigFile = kerberosConfigFile;
}
- @DeprecatedConfigurationProperty(replacement = "spring.flyway.oracle.kerberos-cache-file", since = "3.2.0")
- @Deprecated(since = "3.2.0", forRemoval = true)
- public String getOracleKerberosCacheFile() {
- return getOracle().getKerberosCacheFile();
- }
-
- @Deprecated(since = "3.2.0", forRemoval = true)
- public void setOracleKerberosCacheFile(String oracleKerberosCacheFile) {
- getOracle().setKerberosCacheFile(oracleKerberosCacheFile);
- }
-
public Boolean getOutputQueryResults() {
return this.outputQueryResults;
}
@@ -794,17 +733,6 @@ public class FlywayProperties {
this.outputQueryResults = outputQueryResults;
}
- @DeprecatedConfigurationProperty(replacement = "spring.flyway.sqlserver.kerberos-login-file")
- @Deprecated(since = "3.2.0", forRemoval = true)
- public String getSqlServerKerberosLoginFile() {
- return getSqlserver().getKerberosLoginFile();
- }
-
- @Deprecated(since = "3.2.0", forRemoval = true)
- public void setSqlServerKerberosLoginFile(String sqlServerKerberosLoginFile) {
- getSqlserver().setKerberosLoginFile(sqlServerKerberosLoginFile);
- }
-
public Boolean getSkipExecutingMigrations() {
return this.skipExecutingMigrations;
}
diff --git a/spring-boot-project/spring-boot-flyway/src/test/java/org/springframework/boot/flyway/autoconfigure/FlywayAutoConfigurationTests.java b/spring-boot-project/spring-boot-flyway/src/test/java/org/springframework/boot/flyway/autoconfigure/FlywayAutoConfigurationTests.java
index 79862f0d1f..8545efcd4a 100644
--- a/spring-boot-project/spring-boot-flyway/src/test/java/org/springframework/boot/flyway/autoconfigure/FlywayAutoConfigurationTests.java
+++ b/spring-boot-project/spring-boot-flyway/src/test/java/org/springframework/boot/flyway/autoconfigure/FlywayAutoConfigurationTests.java
@@ -643,19 +643,6 @@ class FlywayAutoConfigurationTests {
}
- @Test
- @Deprecated(since = "3.2.0", forRemoval = true)
- void oracleSqlplusIsCorrectlyMappedWithDeprecatedProperty() {
- this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
- .withPropertyValues("spring.flyway.oracle-sqlplus=true")
- .run((context) -> assertThat(context.getBean(Flyway.class)
- .getConfiguration()
- .getPluginRegister()
- .getPlugin(OracleConfigurationExtension.class)
- .getSqlplus()).isTrue());
-
- }
-
@Test
void oracleSqlplusWarnIsCorrectlyMapped() {
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
@@ -667,18 +654,6 @@ class FlywayAutoConfigurationTests {
.getSqlplusWarn()).isTrue());
}
- @Test
- @Deprecated(since = "3.2.0", forRemoval = true)
- void oracleSqlplusWarnIsCorrectlyMappedWithDeprecatedProperty() {
- this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
- .withPropertyValues("spring.flyway.oracle-sqlplus-warn=true")
- .run((context) -> assertThat(context.getBean(Flyway.class)
- .getConfiguration()
- .getPluginRegister()
- .getPlugin(OracleConfigurationExtension.class)
- .getSqlplusWarn()).isTrue());
- }
-
@Test
void oracleWallerLocationIsCorrectlyMapped() {
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
@@ -690,18 +665,6 @@ class FlywayAutoConfigurationTests {
.getWalletLocation()).isEqualTo("/tmp/my.wallet"));
}
- @Test
- @Deprecated(since = "3.2.0", forRemoval = true)
- void oracleWallerLocationIsCorrectlyMappedWithDeprecatedProperty() {
- this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
- .withPropertyValues("spring.flyway.oracle-wallet-location=/tmp/my.wallet")
- .run((context) -> assertThat(context.getBean(Flyway.class)
- .getConfiguration()
- .getPluginRegister()
- .getPlugin(OracleConfigurationExtension.class)
- .getWalletLocation()).isEqualTo("/tmp/my.wallet"));
- }
-
@Test
void oracleKerberosCacheFileIsCorrectlyMapped() {
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
@@ -713,18 +676,6 @@ class FlywayAutoConfigurationTests {
.getKerberosCacheFile()).isEqualTo("/tmp/cache"));
}
- @Test
- @Deprecated(since = "3.2.0", forRemoval = true)
- void oracleKerberosCacheFileIsCorrectlyMappedWithDeprecatedProperty() {
- this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
- .withPropertyValues("spring.flyway.oracle-kerberos-cache-file=/tmp/cache")
- .run((context) -> assertThat(context.getBean(Flyway.class)
- .getConfiguration()
- .getPluginRegister()
- .getPlugin(OracleConfigurationExtension.class)
- .getKerberosCacheFile()).isEqualTo("/tmp/cache"));
- }
-
@Test
void streamIsCorrectlyMapped() {
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
@@ -835,20 +786,6 @@ class FlywayAutoConfigurationTests {
.getFile()).isEqualTo("/tmp/config"));
}
- @Test
- @Deprecated(since = "3.2.0", forRemoval = true)
- void sqlServerKerberosLoginFileIsCorrectlyMappedWithDeprecatedProperty() {
- this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
- .withPropertyValues("spring.flyway.sql-server-kerberos-login-file=/tmp/config")
- .run((context) -> assertThat(context.getBean(Flyway.class)
- .getConfiguration()
- .getPluginRegister()
- .getPlugin(SQLServerConfigurationExtension.class)
- .getKerberos()
- .getLogin()
- .getFile()).isEqualTo("/tmp/config"));
- }
-
@Test
void skipExecutingMigrationsIsCorrectlyMapped() {
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
diff --git a/spring-boot-project/spring-boot-flyway/src/test/java/org/springframework/boot/flyway/autoconfigure/FlywayPropertiesTests.java b/spring-boot-project/spring-boot-flyway/src/test/java/org/springframework/boot/flyway/autoconfigure/FlywayPropertiesTests.java
index 6b09452fcd..b66c59f2cd 100644
--- a/spring-boot-project/spring-boot-flyway/src/test/java/org/springframework/boot/flyway/autoconfigure/FlywayPropertiesTests.java
+++ b/spring-boot-project/spring-boot-flyway/src/test/java/org/springframework/boot/flyway/autoconfigure/FlywayPropertiesTests.java
@@ -81,7 +81,6 @@ class FlywayPropertiesTests {
assertThat(properties.getInitSqls()).isEmpty();
assertThat(properties.isBaselineOnMigrate()).isEqualTo(configuration.isBaselineOnMigrate());
assertThat(properties.isCleanDisabled()).isEqualTo(configuration.isCleanDisabled());
- assertThat(properties.isCleanOnValidationError()).isEqualTo(configuration.isCleanOnValidationError());
assertThat(properties.isGroup()).isEqualTo(configuration.isGroup());
assertThat(properties.isMixed()).isEqualTo(configuration.isMixed());
assertThat(properties.isOutOfOrder()).isEqualTo(configuration.isOutOfOrder());
@@ -111,9 +110,6 @@ class FlywayPropertiesTests {
PropertyAccessorFactory.forBeanPropertyAccess(new ClassicConfiguration()));
// Properties specific settings
ignoreProperties(properties, "url", "driverClassName", "user", "password", "enabled");
- // Deprecated properties
- ignoreProperties(properties, "oracleKerberosCacheFile", "oracleSqlplus", "oracleSqlplusWarn",
- "oracleWalletLocation", "sqlServerKerberosLoginFile");
// Properties that are managed by specific extensions
ignoreProperties(properties, "oracle", "postgresql", "sqlserver");
// Properties that are only used on the command line
@@ -127,7 +123,7 @@ class FlywayPropertiesTests {
ignoreProperties(configuration, "resolversAsClassNames", "callbacksAsClassNames", "driver", "modernConfig",
"currentResolvedEnvironment", "reportFilename", "reportEnabled", "workingDirectory",
"cachedDataSources", "cachedResolvedEnvironments", "currentEnvironmentName", "allEnvironments",
- "environmentProvisionMode", "provisionMode");
+ "environmentProvisionMode", "provisionMode", "cleanOnValidationError");
// Handled by the conversion service
ignoreProperties(configuration, "baselineVersionAsString", "encodingAsString", "locationsAsStrings",
"targetAsString");
diff --git a/spring-boot-project/spring-boot-graphql/src/main/java/org/springframework/boot/graphql/autoconfigure/GraphQlProperties.java b/spring-boot-project/spring-boot-graphql/src/main/java/org/springframework/boot/graphql/autoconfigure/GraphQlProperties.java
index 7580a07ca7..27f535ac12 100644
--- a/spring-boot-project/spring-boot-graphql/src/main/java/org/springframework/boot/graphql/autoconfigure/GraphQlProperties.java
+++ b/spring-boot-project/spring-boot-graphql/src/main/java/org/springframework/boot/graphql/autoconfigure/GraphQlProperties.java
@@ -20,7 +20,6 @@ import java.time.Duration;
import java.util.Arrays;
import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
import org.springframework.core.io.Resource;
/**
@@ -40,8 +39,6 @@ public class GraphQlProperties {
private final Schema schema = new Schema();
- private final DeprecatedSse sse = new DeprecatedSse(this.http.getSse());
-
private final Websocket websocket = new Websocket();
public Http getHttp() {
@@ -52,17 +49,6 @@ public class GraphQlProperties {
return this.graphiql;
}
- @DeprecatedConfigurationProperty(replacement = "spring.graphql.http.path", since = "3.5.0")
- @Deprecated(since = "3.5.0", forRemoval = true)
- public String getPath() {
- return getHttp().getPath();
- }
-
- @Deprecated(since = "3.5.0", forRemoval = true)
- public void setPath(String path) {
- getHttp().setPath(path);
- }
-
public Schema getSchema() {
return this.schema;
}
@@ -75,10 +61,6 @@ public class GraphQlProperties {
return this.rsocket;
}
- public DeprecatedSse getSse() {
- return this.sse;
- }
-
public static class Http {
/**
@@ -343,26 +325,4 @@ public class GraphQlProperties {
}
- @Deprecated(since = "3.5.1", forRemoval = true)
- public static final class DeprecatedSse {
-
- private final Sse sse;
-
- private DeprecatedSse(Sse sse) {
- this.sse = sse;
- }
-
- @DeprecatedConfigurationProperty(replacement = "spring.graphql.http.sse.timeout", since = "3.5.0")
- @Deprecated(since = "3.5.0", forRemoval = true)
- public Duration getTimeout() {
- return this.sse.getTimeout();
- }
-
- @Deprecated(since = "3.5.0", forRemoval = true)
- public void setTimeout(Duration timeout) {
- this.sse.setTimeout(timeout);
- }
-
- }
-
}
diff --git a/spring-boot-project/spring-boot-groovy-templates/src/test/java/org/springframework/boot/groovy/template/autoconfigure/GroovyTemplateAutoConfigurationTests.java b/spring-boot-project/spring-boot-groovy-templates/src/test/java/org/springframework/boot/groovy/template/autoconfigure/GroovyTemplateAutoConfigurationTests.java
index bdaf19cc9d..ab19132c01 100644
--- a/spring-boot-project/spring-boot-groovy-templates/src/test/java/org/springframework/boot/groovy/template/autoconfigure/GroovyTemplateAutoConfigurationTests.java
+++ b/spring-boot-project/spring-boot-groovy-templates/src/test/java/org/springframework/boot/groovy/template/autoconfigure/GroovyTemplateAutoConfigurationTests.java
@@ -187,13 +187,6 @@ class GroovyTemplateAutoConfigurationTests {
assertThat(writer.toString()).contains("Hello World");
}
- @Test
- @Deprecated(since = "3.5.0", forRemoval = true)
- void customConfiguration() {
- registerAndRefreshContext("spring.groovy.template.configuration.auto-indent:true");
- assertThat(this.context.getBean(GroovyMarkupConfigurer.class).isAutoIndent()).isTrue();
- }
-
@Test
void enableAutoEscape() {
registerAndRefreshContext("spring.groovy.template.auto-escape:true");
diff --git a/spring-boot-project/spring-boot-gson/src/main/java/org/springframework/boot/gson/autoconfigure/GsonProperties.java b/spring-boot-project/spring-boot-gson/src/main/java/org/springframework/boot/gson/autoconfigure/GsonProperties.java
index d0f149c6d8..4ac8b7d517 100644
--- a/spring-boot-project/spring-boot-gson/src/main/java/org/springframework/boot/gson/autoconfigure/GsonProperties.java
+++ b/spring-boot-project/spring-boot-gson/src/main/java/org/springframework/boot/gson/autoconfigure/GsonProperties.java
@@ -21,7 +21,6 @@ import com.google.gson.Gson;
import com.google.gson.LongSerializationPolicy;
import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
/**
* Configuration properties to configure {@link Gson}.
@@ -163,12 +162,6 @@ public class GsonProperties {
this.strictness = strictness;
}
- @Deprecated(since = "3.4.0", forRemoval = true)
- @DeprecatedConfigurationProperty(replacement = "spring.gson.strictness", since = "3.4.0")
- public Boolean getLenient() {
- return (this.strictness != null) && (this.strictness == Strictness.LENIENT);
- }
-
public void setLenient(Boolean lenient) {
setStrictness((lenient != null && lenient) ? Strictness.LENIENT : Strictness.STRICT);
}
diff --git a/spring-boot-project/spring-boot-gson/src/test/java/org/springframework/boot/gson/autoconfigure/Gson210AutoConfigurationTests.java b/spring-boot-project/spring-boot-gson/src/test/java/org/springframework/boot/gson/autoconfigure/Gson210AutoConfigurationTests.java
index 433e15560f..23fa55ec2e 100644
--- a/spring-boot-project/spring-boot-gson/src/test/java/org/springframework/boot/gson/autoconfigure/Gson210AutoConfigurationTests.java
+++ b/spring-boot-project/spring-boot-gson/src/test/java/org/springframework/boot/gson/autoconfigure/Gson210AutoConfigurationTests.java
@@ -46,33 +46,6 @@ class Gson210AutoConfigurationTests {
});
}
- @Test
- @Deprecated(since = "3.4.0", forRemoval = true)
- void withoutLenient() {
- this.contextRunner.run((context) -> {
- Gson gson = context.getBean(Gson.class);
- assertThat(gson).hasFieldOrPropertyWithValue("lenient", false);
- });
- }
-
- @Test
- @Deprecated(since = "3.4.0", forRemoval = true)
- void withLenientTrue() {
- this.contextRunner.withPropertyValues("spring.gson.lenient:true").run((context) -> {
- Gson gson = context.getBean(Gson.class);
- assertThat(gson).hasFieldOrPropertyWithValue("lenient", true);
- });
- }
-
- @Test
- @Deprecated(since = "3.4.0", forRemoval = true)
- void withLenientFalse() {
- this.contextRunner.withPropertyValues("spring.gson.lenient:false").run((context) -> {
- Gson gson = context.getBean(Gson.class);
- assertThat(gson).hasFieldOrPropertyWithValue("lenient", false);
- });
- }
-
public class DataObject {
@SuppressWarnings("unused")
diff --git a/spring-boot-project/spring-boot-gson/src/test/java/org/springframework/boot/gson/autoconfigure/GsonAutoConfigurationTests.java b/spring-boot-project/spring-boot-gson/src/test/java/org/springframework/boot/gson/autoconfigure/GsonAutoConfigurationTests.java
index 89f6b74788..4a874883c0 100644
--- a/spring-boot-project/spring-boot-gson/src/test/java/org/springframework/boot/gson/autoconfigure/GsonAutoConfigurationTests.java
+++ b/spring-boot-project/spring-boot-gson/src/test/java/org/springframework/boot/gson/autoconfigure/GsonAutoConfigurationTests.java
@@ -209,33 +209,6 @@ class GsonAutoConfigurationTests {
});
}
- @Test
- @Deprecated(since = "3.4.0", forRemoval = true)
- void withoutLenient() {
- this.contextRunner.run((context) -> {
- Gson gson = context.getBean(Gson.class);
- assertThat(gson).hasFieldOrPropertyWithValue("strictness", null);
- });
- }
-
- @Test
- @Deprecated(since = "3.4.0", forRemoval = true)
- void withLenientTrue() {
- this.contextRunner.withPropertyValues("spring.gson.lenient:true").run((context) -> {
- Gson gson = context.getBean(Gson.class);
- assertThat(gson).hasFieldOrPropertyWithValue("strictness", Strictness.LENIENT);
- });
- }
-
- @Test
- @Deprecated(since = "3.4.0", forRemoval = true)
- void withLenientFalse() {
- this.contextRunner.withPropertyValues("spring.gson.lenient:false").run((context) -> {
- Gson gson = context.getBean(Gson.class);
- assertThat(gson).hasFieldOrPropertyWithValue("strictness", Strictness.STRICT);
- });
- }
-
@Test
void withoutStrictness() {
this.contextRunner.run((context) -> {
diff --git a/spring-boot-project/spring-boot-jdbc/src/main/java/org/springframework/boot/jdbc/HikariCheckpointRestoreLifecycle.java b/spring-boot-project/spring-boot-jdbc/src/main/java/org/springframework/boot/jdbc/HikariCheckpointRestoreLifecycle.java
index 56cfe28ef1..b44289d818 100644
--- a/spring-boot-project/spring-boot-jdbc/src/main/java/org/springframework/boot/jdbc/HikariCheckpointRestoreLifecycle.java
+++ b/spring-boot-project/spring-boot-jdbc/src/main/java/org/springframework/boot/jdbc/HikariCheckpointRestoreLifecycle.java
@@ -75,20 +75,6 @@ public class HikariCheckpointRestoreLifecycle implements Lifecycle {
private final ConfigurableApplicationContext applicationContext;
- /**
- * Creates a new {@code HikariCheckpointRestoreLifecycle} that will allow the given
- * {@code dataSource} to participate in checkpoint-restore. The {@code dataSource} is
- * {@link DataSourceUnwrapper#unwrap unwrapped} to a {@link HikariDataSource}. If such
- * unwrapping is not possible, the lifecycle will have no effect.
- * @param dataSource the checkpoint-restore participant
- * @deprecated since 3.4.0 for removal in 4.0.0 in favor of
- * {@link #HikariCheckpointRestoreLifecycle(DataSource, ConfigurableApplicationContext)}
- */
- @Deprecated(since = "3.4.0", forRemoval = true)
- public HikariCheckpointRestoreLifecycle(DataSource dataSource) {
- this(dataSource, null);
- }
-
/**
* Creates a new {@code HikariCheckpointRestoreLifecycle} that will allow the given
* {@code dataSource} to participate in checkpoint-restore. The {@code dataSource} is
diff --git a/spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/DefaultJmsListenerContainerFactoryConfigurer.java b/spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/DefaultJmsListenerContainerFactoryConfigurer.java
index fee743bd4c..21d1fcb99f 100644
--- a/spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/DefaultJmsListenerContainerFactoryConfigurer.java
+++ b/spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/DefaultJmsListenerContainerFactoryConfigurer.java
@@ -105,12 +105,8 @@ public final class DefaultJmsListenerContainerFactoryConfigurer {
/**
* Set the {@link ObservationRegistry} to use.
* @param observationRegistry the {@link ObservationRegistry}
- * @since 3.2.1
- * @deprecated since 3.3.10 for removal in 4.0.0 as this should have been package
- * private
*/
- @Deprecated(since = "3.3.10", forRemoval = true)
- public void setObservationRegistry(ObservationRegistry observationRegistry) {
+ void setObservationRegistry(ObservationRegistry observationRegistry) {
this.observationRegistry = observationRegistry;
}
diff --git a/spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/JmsProperties.java b/spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/JmsProperties.java
index 8e9723780a..b74dcc64c4 100644
--- a/spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/JmsProperties.java
+++ b/spring-boot-project/spring-boot-jms/src/main/java/org/springframework/boot/jms/autoconfigure/JmsProperties.java
@@ -19,7 +19,6 @@ package org.springframework.boot.jms.autoconfigure;
import java.time.Duration;
import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
/**
* Configuration properties for JMS.
@@ -203,28 +202,6 @@ public class JmsProperties {
this.autoStartup = autoStartup;
}
- @Deprecated(since = "3.2.0", forRemoval = true)
- @DeprecatedConfigurationProperty(replacement = "spring.jms.listener.session.acknowledge-mode", since = "3.2.0")
- public AcknowledgeMode getAcknowledgeMode() {
- return this.session.getAcknowledgeMode();
- }
-
- @Deprecated(since = "3.2.0", forRemoval = true)
- public void setAcknowledgeMode(AcknowledgeMode acknowledgeMode) {
- this.session.setAcknowledgeMode(acknowledgeMode);
- }
-
- @DeprecatedConfigurationProperty(replacement = "spring.jms.listener.min-concurrency", since = "3.2.0")
- @Deprecated(since = "3.2.0", forRemoval = true)
- public Integer getConcurrency() {
- return this.minConcurrency;
- }
-
- @Deprecated(since = "3.2.0", forRemoval = true)
- public void setConcurrency(Integer concurrency) {
- this.minConcurrency = concurrency;
- }
-
public Integer getMinConcurrency() {
return this.minConcurrency;
}
diff --git a/spring-boot-project/spring-boot-jpa/src/main/java/org/springframework/boot/jpa/EntityManagerFactoryBuilder.java b/spring-boot-project/spring-boot-jpa/src/main/java/org/springframework/boot/jpa/EntityManagerFactoryBuilder.java
index 103eac4cb6..89810cb0df 100644
--- a/spring-boot-project/spring-boot-jpa/src/main/java/org/springframework/boot/jpa/EntityManagerFactoryBuilder.java
+++ b/spring-boot-project/spring-boot-jpa/src/main/java/org/springframework/boot/jpa/EntityManagerFactoryBuilder.java
@@ -99,41 +99,6 @@ public class EntityManagerFactoryBuilder {
this.persistenceUnitRootLocation = persistenceUnitRootLocation;
}
- /**
- * Create a new instance passing in the common pieces that will be shared if multiple
- * EntityManagerFactory instances are created.
- * @param jpaVendorAdapter a vendor adapter
- * @param jpaProperties the JPA properties to be passed to the persistence provider
- * @param persistenceUnitManager optional source of persistence unit information (can
- * be null)
- * @deprecated since 3.4.4 for removal in 4.0.0 in favor of
- * {@link #EntityManagerFactoryBuilder(JpaVendorAdapter, Function, PersistenceUnitManager)}
- */
- @Deprecated(since = "3.4.4", forRemoval = true)
- public EntityManagerFactoryBuilder(JpaVendorAdapter jpaVendorAdapter, Map jpaProperties,
- PersistenceUnitManager persistenceUnitManager) {
- this(jpaVendorAdapter, (datasource) -> jpaProperties, persistenceUnitManager, null);
- }
-
- /**
- * Create a new instance passing in the common pieces that will be shared if multiple
- * EntityManagerFactory instances are created.
- * @param jpaVendorAdapter a vendor adapter
- * @param jpaProperties the JPA properties to be passed to the persistence provider
- * @param persistenceUnitManager optional source of persistence unit information (can
- * be null)
- * @param persistenceUnitRootLocation the persistence unit root location to use as a
- * fallback or {@code null}
- * @since 1.4.1
- * @deprecated since 3.4.4 for removal in 4.0.0 in favor of
- * {@link #EntityManagerFactoryBuilder(JpaVendorAdapter, Function, PersistenceUnitManager, URL)}
- */
- @Deprecated(since = "3.4.4", forRemoval = true)
- public EntityManagerFactoryBuilder(JpaVendorAdapter jpaVendorAdapter, Map jpaProperties,
- PersistenceUnitManager persistenceUnitManager, URL persistenceUnitRootLocation) {
- this(jpaVendorAdapter, (datasource) -> jpaProperties, persistenceUnitManager, persistenceUnitRootLocation);
- }
-
/**
* Create a new {@link Builder} for a {@code EntityManagerFactory} using the settings
* of the given instance, and the given {@link DataSource}.
diff --git a/spring-boot-project/spring-boot-jpa/src/main/java/org/springframework/boot/jpa/autoconfigure/JpaBaseConfiguration.java b/spring-boot-project/spring-boot-jpa/src/main/java/org/springframework/boot/jpa/autoconfigure/JpaBaseConfiguration.java
index 8e4ac4ed2e..28e181647a 100644
--- a/spring-boot-project/spring-boot-jpa/src/main/java/org/springframework/boot/jpa/autoconfigure/JpaBaseConfiguration.java
+++ b/spring-boot-project/spring-boot-jpa/src/main/java/org/springframework/boot/jpa/autoconfigure/JpaBaseConfiguration.java
@@ -156,17 +156,6 @@ public abstract class JpaBaseConfiguration {
*/
protected abstract Map getVendorProperties(DataSource dataSource);
- /**
- * Return the vendor-specific properties.
- * @return the vendor properties
- * @deprecated since 3.4.4 for removal in 4.0.0 in favor of
- * {@link #getVendorProperties(DataSource)}
- */
- @Deprecated(since = "3.4.4", forRemoval = true)
- protected Map getVendorProperties() {
- return getVendorProperties(getDataSource());
- }
-
/**
* Customize vendor properties before they are used. Allows for post-processing (for
* example to configure JTA specific settings).
diff --git a/spring-boot-project/spring-boot-kafka/src/dockerTest/java/org/springframework/boot/kafka/testcontainers/DeprecatedConfluentKafkaContainerConnectionDetailsFactoryIntegrationTests.java b/spring-boot-project/spring-boot-kafka/src/dockerTest/java/org/springframework/boot/kafka/testcontainers/DeprecatedConfluentKafkaContainerConnectionDetailsFactoryIntegrationTests.java
deleted file mode 100644
index 8bd1078822..0000000000
--- a/spring-boot-project/spring-boot-kafka/src/dockerTest/java/org/springframework/boot/kafka/testcontainers/DeprecatedConfluentKafkaContainerConnectionDetailsFactoryIntegrationTests.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright 2012-2025 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.boot.kafka.testcontainers;
-
-import java.time.Duration;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.awaitility.Awaitility;
-import org.junit.jupiter.api.Test;
-import org.testcontainers.containers.KafkaContainer;
-import org.testcontainers.junit.jupiter.Container;
-import org.testcontainers.junit.jupiter.Testcontainers;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
-import org.springframework.boot.kafka.autoconfigure.KafkaAutoConfiguration;
-import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
-import org.springframework.boot.testsupport.container.TestImage;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.kafka.annotation.KafkaListener;
-import org.springframework.kafka.core.KafkaTemplate;
-import org.springframework.test.context.TestPropertySource;
-import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-/**
- * Tests for {@link DeprecatedConfluentKafkaContainerConnectionDetailsFactory}.
- *
- * @author Moritz Halbritter
- * @author Andy Wilkinson
- * @author Phillip Webb
- * @deprecated since 3.4.0 for removal in 4.0.0
- */
-@SpringJUnitConfig
-@Testcontainers(disabledWithoutDocker = true)
-@TestPropertySource(properties = { "spring.kafka.consumer.group-id=test-group",
- "spring.kafka.consumer.auto-offset-reset=earliest" })
-@Deprecated(since = "3.4.0", forRemoval = true)
-class DeprecatedConfluentKafkaContainerConnectionDetailsFactoryIntegrationTests {
-
- @Container
- @ServiceConnection
- static final KafkaContainer kafka = TestImage.container(KafkaContainer.class);
-
- @Autowired
- private KafkaTemplate kafkaTemplate;
-
- @Autowired
- private TestListener listener;
-
- @Test
- void connectionCanBeMadeToKafkaContainer() {
- this.kafkaTemplate.send("test-topic", "test-data");
- Awaitility.waitAtMost(Duration.ofMinutes(4))
- .untilAsserted(() -> assertThat(this.listener.messages).containsExactly("test-data"));
- }
-
- @Configuration(proxyBeanMethods = false)
- @ImportAutoConfiguration(KafkaAutoConfiguration.class)
- static class TestConfiguration {
-
- @Bean
- TestListener testListener() {
- return new TestListener();
- }
-
- }
-
- static class TestListener {
-
- private final List messages = new ArrayList<>();
-
- @KafkaListener(topics = "test-topic")
- void processMessage(String message) {
- this.messages.add(message);
- }
-
- }
-
-}
diff --git a/spring-boot-project/spring-boot-kafka/src/main/java/org/springframework/boot/kafka/autoconfigure/KafkaConnectionDetails.java b/spring-boot-project/spring-boot-kafka/src/main/java/org/springframework/boot/kafka/autoconfigure/KafkaConnectionDetails.java
index b015a45663..12dd746461 100644
--- a/spring-boot-project/spring-boot-kafka/src/main/java/org/springframework/boot/kafka/autoconfigure/KafkaConnectionDetails.java
+++ b/spring-boot-project/spring-boot-kafka/src/main/java/org/springframework/boot/kafka/autoconfigure/KafkaConnectionDetails.java
@@ -85,46 +85,6 @@ public interface KafkaConnectionDetails extends ConnectionDetails {
return Configuration.of(getBootstrapServers(), getSslBundle(), getSecurityProtocol());
}
- /**
- * Returns the list of bootstrap servers used for consumers.
- * @return the list of bootstrap servers used for consumers
- * @deprecated since 3.5.0 for removal in 4.0.0 in favor of {@link #getConsumer()}
- */
- @Deprecated(since = "3.5.0", forRemoval = true)
- default List getConsumerBootstrapServers() {
- return getConsumer().getBootstrapServers();
- }
-
- /**
- * Returns the list of bootstrap servers used for producers.
- * @return the list of bootstrap servers used for producers
- * @deprecated since 3.5.0 for removal in 4.0.0 in favor of {@link #getProducer()}
- */
- @Deprecated(since = "3.5.0", forRemoval = true)
- default List getProducerBootstrapServers() {
- return getProducer().getBootstrapServers();
- }
-
- /**
- * Returns the list of bootstrap servers used for the admin.
- * @return the list of bootstrap servers used for the admin
- * @deprecated since 3.5.0 for removal in 4.0.0 in favor of {@link #getAdmin()}
- */
- @Deprecated(since = "3.5.0", forRemoval = true)
- default List getAdminBootstrapServers() {
- return getAdmin().getBootstrapServers();
- }
-
- /**
- * Returns the list of bootstrap servers used for Kafka Streams.
- * @return the list of bootstrap servers used for Kafka Streams
- * @deprecated since 3.5.0 for removal in 4.0.0 in favor of {@link #getStreams()}
- */
- @Deprecated(since = "3.5.0", forRemoval = true)
- default List getStreamsBootstrapServers() {
- return getStreams().getBootstrapServers();
- }
-
/**
* Kafka connection details configuration.
*/
diff --git a/spring-boot-project/spring-boot-kafka/src/main/java/org/springframework/boot/kafka/autoconfigure/KafkaProperties.java b/spring-boot-project/spring-boot-kafka/src/main/java/org/springframework/boot/kafka/autoconfigure/KafkaProperties.java
index ac5c7db045..a7b6e144c9 100644
--- a/spring-boot-project/spring-boot-kafka/src/main/java/org/springframework/boot/kafka/autoconfigure/KafkaProperties.java
+++ b/spring-boot-project/spring-boot-kafka/src/main/java/org/springframework/boot/kafka/autoconfigure/KafkaProperties.java
@@ -34,7 +34,6 @@ import org.apache.kafka.common.serialization.StringDeserializer;
import org.apache.kafka.common.serialization.StringSerializer;
import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
import org.springframework.boot.context.properties.PropertyMapper;
import org.springframework.boot.context.properties.source.MutuallyExclusiveConfigurationPropertiesException;
import org.springframework.boot.convert.DurationUnit;
@@ -1423,11 +1422,6 @@ public class KafkaProperties {
this.protocol = protocol;
}
- @Deprecated(since = "3.2.0", forRemoval = true)
- public Map buildProperties() {
- return buildProperties(null);
- }
-
public Map buildProperties(SslBundles sslBundles) {
validate();
String bundleName = getBundle();
@@ -1619,51 +1613,6 @@ public class KafkaProperties {
this.attempts = attempts;
}
- @DeprecatedConfigurationProperty(replacement = "spring.kafka.retry.topic.backoff.delay", since = "3.4.0")
- @Deprecated(since = "3.4.0", forRemoval = true)
- public Duration getDelay() {
- return getBackoff().getDelay();
- }
-
- @Deprecated(since = "3.4.0", forRemoval = true)
- public void setDelay(Duration delay) {
- getBackoff().setDelay(delay);
- }
-
- @DeprecatedConfigurationProperty(replacement = "spring.kafka.retry.topic.backoff.multiplier",
- since = "3.4.0")
- @Deprecated(since = "3.4.0", forRemoval = true)
- public double getMultiplier() {
- return getBackoff().getMultiplier();
- }
-
- @Deprecated(since = "3.4.0", forRemoval = true)
- public void setMultiplier(double multiplier) {
- getBackoff().setMultiplier(multiplier);
- }
-
- @DeprecatedConfigurationProperty(replacement = "spring.kafka.retry.topic.backoff.maxDelay", since = "3.4.0")
- @Deprecated(since = "3.4.0", forRemoval = true)
- public Duration getMaxDelay() {
- return getBackoff().getMaxDelay();
- }
-
- @Deprecated(since = "3.4.0", forRemoval = true)
- public void setMaxDelay(Duration maxDelay) {
- getBackoff().setMaxDelay(maxDelay);
- }
-
- @DeprecatedConfigurationProperty(replacement = "spring.kafka.retry.topic.backoff.random", since = "3.4.0")
- @Deprecated(since = "3.4.0", forRemoval = true)
- public boolean isRandomBackOff() {
- return getBackoff().isRandom();
- }
-
- @Deprecated(since = "3.4.0", forRemoval = true)
- public void setRandomBackOff(boolean randomBackOff) {
- getBackoff().setRandom(randomBackOff);
- }
-
private final Backoff backoff = new Backoff();
public Backoff getBackoff() {
diff --git a/spring-boot-project/spring-boot-kafka/src/main/java/org/springframework/boot/kafka/testcontainers/DeprecatedConfluentKafkaContainerConnectionDetailsFactory.java b/spring-boot-project/spring-boot-kafka/src/main/java/org/springframework/boot/kafka/testcontainers/DeprecatedConfluentKafkaContainerConnectionDetailsFactory.java
deleted file mode 100644
index 8926ecb264..0000000000
--- a/spring-boot-project/spring-boot-kafka/src/main/java/org/springframework/boot/kafka/testcontainers/DeprecatedConfluentKafkaContainerConnectionDetailsFactory.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright 2012-2025 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.boot.kafka.testcontainers;
-
-import java.util.List;
-
-import org.testcontainers.containers.KafkaContainer;
-
-import org.springframework.boot.kafka.autoconfigure.KafkaConnectionDetails;
-import org.springframework.boot.ssl.SslBundle;
-import org.springframework.boot.testcontainers.service.connection.ContainerConnectionDetailsFactory;
-import org.springframework.boot.testcontainers.service.connection.ContainerConnectionSource;
-import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
-
-/**
- * {@link ContainerConnectionDetailsFactory} to create {@link KafkaConnectionDetails} from
- * a {@link ServiceConnection @ServiceConnection}-annotated {@link KafkaContainer}.
- *
- * @author Moritz Halbritter
- * @author Andy Wilkinson
- * @author Phillip Webb
- * @deprecated since 3.4.0 for removal in 4.0.0 in favor of
- * {@link ConfluentKafkaContainerConnectionDetailsFactory}.
- */
-@Deprecated(since = "3.4.0", forRemoval = true)
-class DeprecatedConfluentKafkaContainerConnectionDetailsFactory
- extends ContainerConnectionDetailsFactory {
-
- @Override
- protected KafkaConnectionDetails getContainerConnectionDetails(ContainerConnectionSource source) {
- return new ConfluentKafkaContainerConnectionDetails(source);
- }
-
- /**
- * {@link KafkaConnectionDetails} backed by a {@link ContainerConnectionSource}.
- */
- private static final class ConfluentKafkaContainerConnectionDetails
- extends ContainerConnectionDetails implements KafkaConnectionDetails {
-
- private ConfluentKafkaContainerConnectionDetails(ContainerConnectionSource source) {
- super(source);
- }
-
- @Override
- public List getBootstrapServers() {
- return List.of(getContainer().getBootstrapServers());
- }
-
- @Override
- public SslBundle getSslBundle() {
- return super.getSslBundle();
- }
-
- @Override
- public String getSecurityProtocol() {
- return (getSslBundle() != null) ? "SSL" : "PLAINTEXT";
- }
-
- }
-
-}
diff --git a/spring-boot-project/spring-boot-kafka/src/main/resources/META-INF/spring.factories b/spring-boot-project/spring-boot-kafka/src/main/resources/META-INF/spring.factories
index 25a983d8b3..4a30c0c82e 100644
--- a/spring-boot-project/spring-boot-kafka/src/main/resources/META-INF/spring.factories
+++ b/spring-boot-project/spring-boot-kafka/src/main/resources/META-INF/spring.factories
@@ -2,5 +2,4 @@
org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactory=\
org.springframework.boot.kafka.testcontainers.ApacheKafkaContainerConnectionDetailsFactory,\
org.springframework.boot.kafka.testcontainers.ConfluentKafkaContainerConnectionDetailsFactory,\
-org.springframework.boot.kafka.testcontainers.DeprecatedConfluentKafkaContainerConnectionDetailsFactory,\
org.springframework.boot.kafka.testcontainers.RedpandaContainerConnectionDetailsFactory
diff --git a/spring-boot-project/spring-boot-kafka/src/test/java/org/springframework/boot/kafka/autoconfigure/KafkaAutoConfigurationIntegrationTests.java b/spring-boot-project/spring-boot-kafka/src/test/java/org/springframework/boot/kafka/autoconfigure/KafkaAutoConfigurationIntegrationTests.java
index cf1dcb368b..3eaf55320e 100644
--- a/spring-boot-project/spring-boot-kafka/src/test/java/org/springframework/boot/kafka/autoconfigure/KafkaAutoConfigurationIntegrationTests.java
+++ b/spring-boot-project/spring-boot-kafka/src/test/java/org/springframework/boot/kafka/autoconfigure/KafkaAutoConfigurationIntegrationTests.java
@@ -103,8 +103,8 @@ class KafkaAutoConfigurationIntegrationTests {
void testEndToEndWithRetryTopics() throws Exception {
load(KafkaConfig.class, "spring.kafka.bootstrap-servers:" + getEmbeddedKafkaBrokersAsString(),
"spring.kafka.consumer.group-id=testGroup", "spring.kafka.retry.topic.enabled=true",
- "spring.kafka.retry.topic.attempts=5", "spring.kafka.retry.topic.delay=100ms",
- "spring.kafka.retry.topic.multiplier=2", "spring.kafka.retry.topic.max-delay=300ms",
+ "spring.kafka.retry.topic.attempts=5", "spring.kafka.retry.topic.backoff.delay=100ms",
+ "spring.kafka.retry.topic.backoff.multiplier=2", "spring.kafka.retry.topic.backoff.max-delay=300ms",
"spring.kafka.consumer.auto-offset-reset=earliest");
RetryTopicConfiguration configuration = this.context.getBean(RetryTopicConfiguration.class);
assertThat(configuration.getDestinationTopicProperties()).extracting(DestinationTopic.Properties::delay)
diff --git a/spring-boot-project/spring-boot-kafka/src/test/java/org/springframework/boot/kafka/autoconfigure/KafkaAutoConfigurationTests.java b/spring-boot-project/spring-boot-kafka/src/test/java/org/springframework/boot/kafka/autoconfigure/KafkaAutoConfigurationTests.java
index da8e164fe9..0ad1f5f568 100644
--- a/spring-boot-project/spring-boot-kafka/src/test/java/org/springframework/boot/kafka/autoconfigure/KafkaAutoConfigurationTests.java
+++ b/spring-boot-project/spring-boot-kafka/src/test/java/org/springframework/boot/kafka/autoconfigure/KafkaAutoConfigurationTests.java
@@ -566,22 +566,6 @@ class KafkaAutoConfigurationTests {
});
}
- @Test
- @Deprecated(since = "3.4.0", forRemoval = true)
- void retryTopicConfigurationWithExponentialBackOffUsingDeprecatedProperties() {
- this.contextRunner.withPropertyValues("spring.application.name=my-test-app",
- "spring.kafka.bootstrap-servers=localhost:9092,localhost:9093", "spring.kafka.retry.topic.enabled=true",
- "spring.kafka.retry.topic.attempts=5", "spring.kafka.retry.topic.delay=100ms",
- "spring.kafka.retry.topic.multiplier=2", "spring.kafka.retry.topic.max-delay=300ms")
- .run((context) -> {
- RetryTopicConfiguration configuration = context.getBean(RetryTopicConfiguration.class);
- assertThat(configuration.getDestinationTopicProperties()).hasSize(5)
- .extracting(DestinationTopic.Properties::delay, DestinationTopic.Properties::suffix)
- .containsExactly(tuple(0L, ""), tuple(100L, "-retry-0"), tuple(200L, "-retry-1"),
- tuple(300L, "-retry-2"), tuple(0L, "-dlt"));
- });
- }
-
@Test
void retryTopicConfigurationWithDefaultProperties() {
this.contextRunner.withPropertyValues("spring.application.name=my-test-app",
@@ -607,18 +591,6 @@ class KafkaAutoConfigurationTests {
.containsExactly(0L, 2000L, 0L)));
}
- @Test
- @Deprecated(since = "3.4.0", forRemoval = true)
- void retryTopicConfigurationWithFixedBackOffUsingDeprecatedProperties() {
- this.contextRunner.withPropertyValues("spring.application.name=my-test-app",
- "spring.kafka.bootstrap-servers=localhost:9092,localhost:9093", "spring.kafka.retry.topic.enabled=true",
- "spring.kafka.retry.topic.attempts=4", "spring.kafka.retry.topic.delay=2s")
- .run(assertRetryTopicConfiguration(
- (configuration) -> assertThat(configuration.getDestinationTopicProperties()).hasSize(3)
- .extracting(DestinationTopic.Properties::delay)
- .containsExactly(0L, 2000L, 0L)));
- }
-
@Test
void retryTopicConfigurationWithNoBackOff() {
this.contextRunner.withPropertyValues("spring.application.name=my-test-app",
@@ -630,18 +602,6 @@ class KafkaAutoConfigurationTests {
.containsExactly(0L, 0L, 0L)));
}
- @Test
- @Deprecated(since = "3.4.0", forRemoval = true)
- void retryTopicConfigurationWithNoBackOffUsingDeprecatedProperties() {
- this.contextRunner.withPropertyValues("spring.application.name=my-test-app",
- "spring.kafka.bootstrap-servers=localhost:9092,localhost:9093", "spring.kafka.retry.topic.enabled=true",
- "spring.kafka.retry.topic.attempts=4", "spring.kafka.retry.topic.delay=0")
- .run(assertRetryTopicConfiguration(
- (configuration) -> assertThat(configuration.getDestinationTopicProperties()).hasSize(3)
- .extracting(DestinationTopic.Properties::delay)
- .containsExactly(0L, 0L, 0L)));
- }
-
private ContextConsumer assertRetryTopicConfiguration(
Consumer configuration) {
return (context) -> {
diff --git a/spring-boot-project/spring-boot-metrics/src/test/java/org/springframework/boot/metrics/autoconfigure/export/otlp/OtlpMetricsPropertiesConfigAdapterTests.java b/spring-boot-project/spring-boot-metrics/src/test/java/org/springframework/boot/metrics/autoconfigure/export/otlp/OtlpMetricsPropertiesConfigAdapterTests.java
index 0090a6b0e4..8754fbd03c 100644
--- a/spring-boot-project/spring-boot-metrics/src/test/java/org/springframework/boot/metrics/autoconfigure/export/otlp/OtlpMetricsPropertiesConfigAdapterTests.java
+++ b/spring-boot-project/spring-boot-metrics/src/test/java/org/springframework/boot/metrics/autoconfigure/export/otlp/OtlpMetricsPropertiesConfigAdapterTests.java
@@ -190,21 +190,21 @@ class OtlpMetricsPropertiesConfigAdapterTests {
}
@Test
- void serviceGroupOverridesApplicationGroup() {
+ void serviceNamespaceOverridesApplicationGroup() {
this.environment.setProperty("spring.application.group", "alpha");
- this.openTelemetryProperties.setResourceAttributes(Map.of("service.group", "beta"));
- assertThat(createAdapter().resourceAttributes()).containsEntry("service.group", "beta");
+ this.openTelemetryProperties.setResourceAttributes(Map.of("service.namespace", "beta"));
+ assertThat(createAdapter().resourceAttributes()).containsEntry("service.namespace", "beta");
}
@Test
- void shouldUseApplicationGroupIfServiceGroupIsNotSet() {
+ void shouldUseApplicationGroupIfServiceNamspaceIsNotSet() {
this.environment.setProperty("spring.application.group", "alpha");
- assertThat(createAdapter().resourceAttributes()).containsEntry("service.group", "alpha");
+ assertThat(createAdapter().resourceAttributes()).containsEntry("service.namespace", "alpha");
}
@Test
void shouldUseDefaultApplicationGroupIfApplicationGroupIsNotSet() {
- assertThat(createAdapter().resourceAttributes()).doesNotContainKey("service.group");
+ assertThat(createAdapter().resourceAttributes()).doesNotContainKey("service.namespace");
}
private OtlpMetricsPropertiesConfigAdapter createAdapter() {
diff --git a/spring-boot-project/spring-boot-mongodb/src/main/java/org/springframework/boot/mongodb/autoconfigure/StandardMongoClientSettingsBuilderCustomizer.java b/spring-boot-project/spring-boot-mongodb/src/main/java/org/springframework/boot/mongodb/autoconfigure/StandardMongoClientSettingsBuilderCustomizer.java
index 5a81c3d835..1b917afdf3 100644
--- a/spring-boot-project/spring-boot-mongodb/src/main/java/org/springframework/boot/mongodb/autoconfigure/StandardMongoClientSettingsBuilderCustomizer.java
+++ b/spring-boot-project/spring-boot-mongodb/src/main/java/org/springframework/boot/mongodb/autoconfigure/StandardMongoClientSettingsBuilderCustomizer.java
@@ -49,25 +49,6 @@ public class StandardMongoClientSettingsBuilderCustomizer implements MongoClient
private int order = 0;
- /**
- * Create a new instance.
- * @param connectionString the connection string
- * @param uuidRepresentation the uuid representation
- * @param ssl the ssl properties
- * @param sslBundles the ssl bundles
- * @deprecated since 3.5.0 for removal in 4.0.0 in favor of
- * {@link #StandardMongoClientSettingsBuilderCustomizer(MongoConnectionDetails, UuidRepresentation)}
- */
- @Deprecated(forRemoval = true, since = "3.5.0")
- public StandardMongoClientSettingsBuilderCustomizer(ConnectionString connectionString,
- UuidRepresentation uuidRepresentation, MongoProperties.Ssl ssl, SslBundles sslBundles) {
- this.connectionDetails = null;
- this.connectionString = connectionString;
- this.uuidRepresentation = uuidRepresentation;
- this.ssl = ssl;
- this.sslBundles = sslBundles;
- }
-
public StandardMongoClientSettingsBuilderCustomizer(MongoConnectionDetails connectionDetails,
UuidRepresentation uuidRepresentation) {
this.connectionString = null;
diff --git a/spring-boot-project/spring-boot-opentelemetry/src/main/java/org/springframework/boot/opentelemetry/autoconfigure/OpenTelemetryResourceAttributes.java b/spring-boot-project/spring-boot-opentelemetry/src/main/java/org/springframework/boot/opentelemetry/autoconfigure/OpenTelemetryResourceAttributes.java
index f7e900c11e..a30bc20d18 100644
--- a/spring-boot-project/spring-boot-opentelemetry/src/main/java/org/springframework/boot/opentelemetry/autoconfigure/OpenTelemetryResourceAttributes.java
+++ b/spring-boot-project/spring-boot-opentelemetry/src/main/java/org/springframework/boot/opentelemetry/autoconfigure/OpenTelemetryResourceAttributes.java
@@ -98,7 +98,6 @@ public class OpenTelemetryResourceAttributes {
}
});
attributes.computeIfAbsent("service.name", (key) -> getApplicationName());
- attributes.computeIfAbsent("service.group", (key) -> getApplicationGroup());
attributes.computeIfAbsent("service.namespace", (key) -> getServiceNamespace());
attributes.forEach(consumer);
}
@@ -107,17 +106,6 @@ public class OpenTelemetryResourceAttributes {
return this.environment.getProperty("spring.application.name", DEFAULT_SERVICE_NAME);
}
- /**
- * Returns the application group.
- * @return the application group
- * @deprecated since 3.5.0 for removal in 4.0.0
- */
- @Deprecated(since = "3.5.0", forRemoval = true)
- private String getApplicationGroup() {
- String applicationGroup = this.environment.getProperty("spring.application.group");
- return (StringUtils.hasLength(applicationGroup)) ? applicationGroup : null;
- }
-
private String getServiceNamespace() {
return this.environment.getProperty("spring.application.group");
}
diff --git a/spring-boot-project/spring-boot-opentelemetry/src/test/java/org/springframework/boot/opentelemetry/autoconfigure/OpenTelemetryResourceAttributesTests.java b/spring-boot-project/spring-boot-opentelemetry/src/test/java/org/springframework/boot/opentelemetry/autoconfigure/OpenTelemetryResourceAttributesTests.java
index a6484c969f..214190ecf0 100644
--- a/spring-boot-project/spring-boot-opentelemetry/src/test/java/org/springframework/boot/opentelemetry/autoconfigure/OpenTelemetryResourceAttributesTests.java
+++ b/spring-boot-project/spring-boot-opentelemetry/src/test/java/org/springframework/boot/opentelemetry/autoconfigure/OpenTelemetryResourceAttributesTests.java
@@ -159,11 +159,10 @@ class OpenTelemetryResourceAttributesTests {
}
@Test
- void springApplicationGroupNameShouldBeUsedAsDefaultServiceGroup() {
+ void springApplicationGroupNameShouldBeUsedAsDefaultServiceNamespace() {
this.environment.setProperty("spring.application.group", "spring-boot");
- assertThat(getAttributes()).hasSize(3)
+ assertThat(getAttributes()).hasSize(2)
.containsEntry("service.name", "unknown_service")
- .containsEntry("service.group", "spring-boot")
.containsEntry("service.namespace", "spring-boot");
}
@@ -212,28 +211,26 @@ class OpenTelemetryResourceAttributesTests {
void resourceAttributesShouldTakePrecedenceOverApplicationGroupNameForPopulatingServiceNamespace() {
this.resourceAttributes.put("service.namespace", "spring-boot-app");
this.environment.setProperty("spring.application.group", "overridden");
- assertThat(getAttributes()).hasSize(3)
+ assertThat(getAttributes()).hasSize(2)
.containsEntry("service.name", "unknown_service")
- .containsEntry("service.group", "overridden")
.containsEntry("service.namespace", "spring-boot-app");
}
@Test
void otelResourceAttributesShouldTakePrecedenceOverSpringApplicationGroupName() {
- this.environmentVariables.put("OTEL_RESOURCE_ATTRIBUTES", "service.group=spring-boot");
+ this.environmentVariables.put("OTEL_RESOURCE_ATTRIBUTES", "service.namespace=spring-boot");
this.environment.setProperty("spring.application.group", "spring-boot-app");
- assertThat(getAttributes()).hasSize(3)
+ assertThat(getAttributes()).hasSize(2)
.containsEntry("service.name", "unknown_service")
- .containsEntry("service.group", "spring-boot")
- .containsEntry("service.namespace", "spring-boot-app");
+ .containsEntry("service.namespace", "spring-boot");
}
@Test
void otelResourceAttributesShouldTakePrecedenceOverSpringApplicationGroupNameForServiceNamespace() {
this.environmentVariables.put("OTEL_RESOURCE_ATTRIBUTES", "service.namespace=spring-boot");
this.environment.setProperty("spring.application.group", "overridden");
- assertThat(getAttributes()).hasSize(3)
- .containsEntry("service.group", "overridden")
+ assertThat(getAttributes()).hasSize(2)
+ .containsEntry("service.name", "unknown_service")
.containsEntry("service.namespace", "spring-boot");
}
diff --git a/spring-boot-project/spring-boot-opentelemetry/src/test/java/org/springframework/boot/opentelemetry/autoconfigure/OpenTelemetrySdkAutoConfigurationTests.java b/spring-boot-project/spring-boot-opentelemetry/src/test/java/org/springframework/boot/opentelemetry/autoconfigure/OpenTelemetrySdkAutoConfigurationTests.java
index 4ac62f6a7e..9c9e322a51 100644
--- a/spring-boot-project/spring-boot-opentelemetry/src/test/java/org/springframework/boot/opentelemetry/autoconfigure/OpenTelemetrySdkAutoConfigurationTests.java
+++ b/spring-boot-project/spring-boot-opentelemetry/src/test/java/org/springframework/boot/opentelemetry/autoconfigure/OpenTelemetrySdkAutoConfigurationTests.java
@@ -123,15 +123,6 @@ class OpenTelemetrySdkAutoConfigurationTests {
});
}
- @Test
- void whenHasApplicationGroupPropertyProvidesServiceGroupResourceAttribute() {
- this.contextRunner.withPropertyValues("spring.application.group=my-group").run((context) -> {
- Resource resource = context.getBean(Resource.class);
- assertThat(resource.getAttributes().asMap())
- .contains(entry(AttributeKey.stringKey("service.group"), "my-group"));
- });
- }
-
@Test
void whenHasApplicationGroupPropertyProvidesServiceNamespaceResourceAttribute() {
this.contextRunner.withPropertyValues("spring.application.group=my-group").run((context) -> {
diff --git a/spring-boot-project/spring-boot-restclient/src/main/java/org/springframework/boot/restclient/RestTemplateBuilder.java b/spring-boot-project/spring-boot-restclient/src/main/java/org/springframework/boot/restclient/RestTemplateBuilder.java
index a34f146c69..aabb94e964 100644
--- a/spring-boot-project/spring-boot-restclient/src/main/java/org/springframework/boot/restclient/RestTemplateBuilder.java
+++ b/spring-boot-project/spring-boot-restclient/src/main/java/org/springframework/boot/restclient/RestTemplateBuilder.java
@@ -446,19 +446,6 @@ public class RestTemplateBuilder {
this.defaultHeaders, this.customizers, this.requestCustomizers);
}
- /**
- * Sets the connection timeout on the underlying {@link ClientHttpRequestFactory}.
- * @param connectTimeout the connection timeout
- * @return a new builder instance.
- * @since 2.1.0
- * @deprecated since 3.4.0 for removal in 4.0.0 in favor of
- * {@link #connectTimeout(Duration)}
- */
- @Deprecated(since = "3.4.0", forRemoval = true)
- public RestTemplateBuilder setConnectTimeout(Duration connectTimeout) {
- return connectTimeout(connectTimeout);
- }
-
/**
* Sets the connection timeout on the underlying {@link ClientHttpRequestFactory}.
* @param connectTimeout the connection timeout
@@ -472,19 +459,6 @@ public class RestTemplateBuilder {
this.defaultHeaders, this.customizers, this.requestCustomizers);
}
- /**
- * Sets the read timeout on the underlying {@link ClientHttpRequestFactory}.
- * @param readTimeout the read timeout
- * @return a new builder instance.
- * @since 2.1.0
- * @deprecated since 3.4.0 for removal in 4.0.0 in favor of
- * {@link #readTimeout(Duration)}
- */
- @Deprecated(since = "3.4.0", forRemoval = true)
- public RestTemplateBuilder setReadTimeout(Duration readTimeout) {
- return readTimeout(readTimeout);
- }
-
/**
* Sets the read timeout on the underlying {@link ClientHttpRequestFactory}.
* @param readTimeout the read timeout
@@ -511,19 +485,6 @@ public class RestTemplateBuilder {
this.customizers, this.requestCustomizers);
}
- /**
- * Sets the SSL bundle on the underlying {@link ClientHttpRequestFactory}.
- * @param sslBundle the SSL bundle
- * @return a new builder instance
- * @since 3.1.0
- * @deprecated since 3.4.0 for removal in 4.0.0 in favor of
- * {@link #sslBundle(SslBundle)}
- */
- @Deprecated(since = "3.4.0", forRemoval = true)
- public RestTemplateBuilder setSslBundle(SslBundle sslBundle) {
- return sslBundle(sslBundle);
- }
-
/**
* Sets the SSL bundle on the underlying {@link ClientHttpRequestFactory}.
* @param sslBundle the SSL bundle
diff --git a/spring-boot-project/spring-boot-security/src/main/java/org/springframework/boot/security/autoconfigure/SecurityProperties.java b/spring-boot-project/spring-boot-security/src/main/java/org/springframework/boot/security/autoconfigure/SecurityProperties.java
index 4557e55939..04a0b80a12 100644
--- a/spring-boot-project/spring-boot-security/src/main/java/org/springframework/boot/security/autoconfigure/SecurityProperties.java
+++ b/spring-boot-project/spring-boot-security/src/main/java/org/springframework/boot/security/autoconfigure/SecurityProperties.java
@@ -47,15 +47,6 @@ public class SecurityProperties {
*/
public static final int BASIC_AUTH_ORDER = Ordered.LOWEST_PRECEDENCE - 5;
- /**
- * Order applied to the {@code WebSecurityCustomizer} that ignores standard static
- * resource paths.
- * @deprecated since 3.5.0 for removal in 4.0.0 since Spring Security no longer
- * recommends using the {@code .ignoring()} method
- */
- @Deprecated(since = "3.5.0", forRemoval = true)
- public static final int IGNORED_ORDER = Ordered.HIGHEST_PRECEDENCE;
-
/**
* Default order of Spring Security's Filter in the servlet container (i.e. amongst
* other filters registered with the container). There is no connection between this
diff --git a/spring-boot-project/spring-boot-test-autoconfigure/build.gradle b/spring-boot-project/spring-boot-test-autoconfigure/build.gradle
index 89dab045f0..b9e1b6b112 100644
--- a/spring-boot-project/spring-boot-test-autoconfigure/build.gradle
+++ b/spring-boot-project/spring-boot-test-autoconfigure/build.gradle
@@ -19,6 +19,8 @@ dependencies {
api(project(":spring-boot-project:spring-boot"))
api(project(":spring-boot-project:spring-boot-autoconfigure"))
api(project(":spring-boot-project:spring-boot-test"))
+
+ compileOnly("org.mockito:mockito-core")
dockerTestImplementation(project(":spring-boot-project:spring-boot-data-mongodb"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-docker-compose"))
diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/ConditionReportApplicationContextFailureProcessor.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/ConditionReportApplicationContextFailureProcessor.java
deleted file mode 100644
index 1735c7671d..0000000000
--- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/ConditionReportApplicationContextFailureProcessor.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2012-2025 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.boot.test.autoconfigure;
-
-import org.springframework.boot.autoconfigure.condition.ConditionEvaluationReport;
-import org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportMessage;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.test.context.ApplicationContextFailureProcessor;
-
-/**
- * An {@link ApplicationContextFailureProcessor} that prints the
- * {@link ConditionEvaluationReport} when the context cannot be prepared.
- *
- * @author Phillip Webb
- * @author Scott Frederick
- * @since 3.0.0
- * @deprecated in 3.2.11 for removal in 4.0.0
- */
-@Deprecated(since = "3.2.11", forRemoval = true)
-public class ConditionReportApplicationContextFailureProcessor implements ApplicationContextFailureProcessor {
-
- @Override
- public void processLoadFailure(ApplicationContext context, Throwable exception) {
- if (context instanceof ConfigurableApplicationContext configurableContext) {
- ConditionEvaluationReport report = ConditionEvaluationReport.get(configurableContext.getBeanFactory());
- System.err.println(new ConditionEvaluationReportMessage(report));
- }
- }
-
-}
diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/ConditionReportApplicationContextFailureProcessorTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/ConditionReportApplicationContextFailureProcessorTests.java
deleted file mode 100644
index ec1c6fefc9..0000000000
--- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/ConditionReportApplicationContextFailureProcessorTests.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright 2012-2025 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.boot.test.autoconfigure;
-
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.WebApplicationType;
-import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
-import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration;
-import org.springframework.boot.test.system.CapturedOutput;
-import org.springframework.boot.test.system.OutputCaptureExtension;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.context.annotation.Configuration;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-/**
- * Tests for {@link ConditionReportApplicationContextFailureProcessor}.
- *
- * @author Phillip Webb
- * @author Scott Frederick
- * @deprecated since 3.2.11 for removal in 4.0.0
- */
-@ExtendWith(OutputCaptureExtension.class)
-@Deprecated(since = "3.2.11", forRemoval = true)
-@SuppressWarnings("removal")
-class ConditionReportApplicationContextFailureProcessorTests {
-
- @Test
- void loadFailureShouldPrintReport(CapturedOutput output) {
- SpringApplication application = new SpringApplication(TestConfig.class);
- application.setWebApplicationType(WebApplicationType.NONE);
- ConfigurableApplicationContext applicationContext = application.run();
- ConditionReportApplicationContextFailureProcessor processor = new ConditionReportApplicationContextFailureProcessor();
- processor.processLoadFailure(applicationContext, new IllegalStateException());
- assertThat(output).contains("CONDITIONS EVALUATION REPORT")
- .contains("Positive matches")
- .contains("Negative matches");
- }
-
- @Configuration(proxyBeanMethods = false)
- @ImportAutoConfiguration(JacksonAutoConfiguration.class)
- static class TestConfig {
-
- }
-
-}
diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/runner/AbstractApplicationContextRunner.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/runner/AbstractApplicationContextRunner.java
index 41b2523375..e7339d3855 100644
--- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/runner/AbstractApplicationContextRunner.java
+++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/runner/AbstractApplicationContextRunner.java
@@ -110,26 +110,10 @@ import org.springframework.util.CollectionUtils;
*/
public abstract class AbstractApplicationContextRunner, C extends ConfigurableApplicationContext, A extends ApplicationContextAssertProvider> {
- private static final Class>[] NO_ADDITIONAL_CONTEXT_INTERFACES = {};
-
private final RunnerConfiguration runnerConfiguration;
private final Function, SELF> instanceFactory;
- /**
- * Create a new {@link AbstractApplicationContextRunner} instance.
- * @param contextFactory the factory used to create the actual context
- * @param instanceFactory the factory used to create new instance of the runner
- * @since 2.6.0
- * @deprecated since 3.4.0 for removal in 4.0.0 in favor of
- * {@link #AbstractApplicationContextRunner(Function, Supplier, Class...)}
- */
- @Deprecated(since = "3.4.0", forRemoval = true)
- protected AbstractApplicationContextRunner(Supplier contextFactory,
- Function, SELF> instanceFactory) {
- this(instanceFactory, contextFactory, NO_ADDITIONAL_CONTEXT_INTERFACES);
- }
-
/**
* Create a new {@link AbstractApplicationContextRunner} instance.
* @param instanceFactory the factory used to create new instance of the runner
diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/Definition.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/Definition.java
deleted file mode 100644
index 4a0446b02b..0000000000
--- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/Definition.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright 2012-2024 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.boot.test.mock.mockito;
-
-import org.springframework.util.ObjectUtils;
-
-/**
- * Base class for {@link MockDefinition} and {@link SpyDefinition}.
- *
- * @author Phillip Webb
- * @see DefinitionsParser
- * @deprecated since 3.4.0 for removal in 4.0.0
- */
-@SuppressWarnings("removal")
-@Deprecated(since = "3.4.0", forRemoval = true)
-abstract class Definition {
-
- private static final int MULTIPLIER = 31;
-
- private final String name;
-
- private final MockReset reset;
-
- private final boolean proxyTargetAware;
-
- private final QualifierDefinition qualifier;
-
- Definition(String name, MockReset reset, boolean proxyTargetAware, QualifierDefinition qualifier) {
- this.name = name;
- this.reset = (reset != null) ? reset : MockReset.AFTER;
- this.proxyTargetAware = proxyTargetAware;
- this.qualifier = qualifier;
- }
-
- /**
- * Return the name for bean.
- * @return the name or {@code null}
- */
- String getName() {
- return this.name;
- }
-
- /**
- * Return the mock reset mode.
- * @return the reset mode
- */
- MockReset getReset() {
- return this.reset;
- }
-
- /**
- * Return if AOP advised beans should be proxy target aware.
- * @return if proxy target aware
- */
- boolean isProxyTargetAware() {
- return this.proxyTargetAware;
- }
-
- /**
- * Return the qualifier or {@code null}.
- * @return the qualifier
- */
- QualifierDefinition getQualifier() {
- return this.qualifier;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- }
- if (obj == null || !getClass().isAssignableFrom(obj.getClass())) {
- return false;
- }
- Definition other = (Definition) obj;
- boolean result = true;
- result = result && ObjectUtils.nullSafeEquals(this.name, other.name);
- result = result && ObjectUtils.nullSafeEquals(this.reset, other.reset);
- result = result && ObjectUtils.nullSafeEquals(this.proxyTargetAware, other.proxyTargetAware);
- result = result && ObjectUtils.nullSafeEquals(this.qualifier, other.qualifier);
- return result;
- }
-
- @Override
- public int hashCode() {
- int result = 1;
- result = MULTIPLIER * result + ObjectUtils.nullSafeHashCode(this.name);
- result = MULTIPLIER * result + ObjectUtils.nullSafeHashCode(this.reset);
- result = MULTIPLIER * result + ObjectUtils.nullSafeHashCode(this.proxyTargetAware);
- result = MULTIPLIER * result + ObjectUtils.nullSafeHashCode(this.qualifier);
- return result;
- }
-
-}
diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/DefinitionsParser.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/DefinitionsParser.java
deleted file mode 100644
index 53ce986778..0000000000
--- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/DefinitionsParser.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright 2012-2024 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.boot.test.mock.mockito;
-
-import java.lang.reflect.AnnotatedElement;
-import java.lang.reflect.Field;
-import java.lang.reflect.TypeVariable;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.springframework.core.ResolvableType;
-import org.springframework.core.annotation.MergedAnnotation;
-import org.springframework.core.annotation.MergedAnnotations;
-import org.springframework.core.annotation.MergedAnnotations.SearchStrategy;
-import org.springframework.util.Assert;
-import org.springframework.util.ReflectionUtils;
-import org.springframework.util.StringUtils;
-
-/**
- * Parser to create {@link MockDefinition} and {@link SpyDefinition} instances from
- * {@link MockBean @MockBean} and {@link SpyBean @SpyBean} annotations declared on or in a
- * class.
- *
- * @author Phillip Webb
- * @author Stephane Nicoll
- * @deprecated since 3.4.0 for removal in 4.0.0
- */
-@SuppressWarnings("removal")
-@Deprecated(since = "3.4.0", forRemoval = true)
-class DefinitionsParser {
-
- private final Set definitions;
-
- private final Map definitionFields;
-
- DefinitionsParser() {
- this(Collections.emptySet());
- }
-
- DefinitionsParser(Collection extends Definition> existing) {
- this.definitions = new LinkedHashSet<>();
- this.definitionFields = new LinkedHashMap<>();
- if (existing != null) {
- this.definitions.addAll(existing);
- }
- }
-
- void parse(Class> source) {
- parseElement(source, null);
- ReflectionUtils.doWithFields(source, (element) -> parseElement(element, source));
- }
-
- private void parseElement(AnnotatedElement element, Class> source) {
- MergedAnnotations annotations = MergedAnnotations.from(element, SearchStrategy.SUPERCLASS);
- annotations.stream(MockBean.class)
- .map(MergedAnnotation::synthesize)
- .forEach((annotation) -> parseMockBeanAnnotation(annotation, element, source));
- annotations.stream(SpyBean.class)
- .map(MergedAnnotation::synthesize)
- .forEach((annotation) -> parseSpyBeanAnnotation(annotation, element, source));
- }
-
- private void parseMockBeanAnnotation(MockBean annotation, AnnotatedElement element, Class> source) {
- Set typesToMock = getOrDeduceTypes(element, annotation.value(), source);
- Assert.state(!typesToMock.isEmpty(), () -> "Unable to deduce type to mock from " + element);
- if (StringUtils.hasLength(annotation.name())) {
- Assert.state(typesToMock.size() == 1, "The name attribute can only be used when mocking a single class");
- }
- for (ResolvableType typeToMock : typesToMock) {
- MockDefinition definition = new MockDefinition(annotation.name(), typeToMock, annotation.extraInterfaces(),
- annotation.answer(), annotation.serializable(), annotation.reset(),
- QualifierDefinition.forElement(element));
- addDefinition(element, definition, "mock");
- }
- }
-
- private void parseSpyBeanAnnotation(SpyBean annotation, AnnotatedElement element, Class> source) {
- Set typesToSpy = getOrDeduceTypes(element, annotation.value(), source);
- Assert.state(!typesToSpy.isEmpty(), () -> "Unable to deduce type to spy from " + element);
- if (StringUtils.hasLength(annotation.name())) {
- Assert.state(typesToSpy.size() == 1, "The name attribute can only be used when spying a single class");
- }
- for (ResolvableType typeToSpy : typesToSpy) {
- SpyDefinition definition = new SpyDefinition(annotation.name(), typeToSpy, annotation.reset(),
- annotation.proxyTargetAware(), QualifierDefinition.forElement(element));
- addDefinition(element, definition, "spy");
- }
- }
-
- private void addDefinition(AnnotatedElement element, Definition definition, String type) {
- boolean isNewDefinition = this.definitions.add(definition);
- Assert.state(isNewDefinition, () -> "Duplicate " + type + " definition " + definition);
- if (element instanceof Field field) {
- this.definitionFields.put(definition, field);
- }
- }
-
- private Set getOrDeduceTypes(AnnotatedElement element, Class>[] value, Class> source) {
- Set types = new LinkedHashSet<>();
- for (Class> type : value) {
- types.add(ResolvableType.forClass(type));
- }
- if (types.isEmpty() && element instanceof Field field) {
- types.add((field.getGenericType() instanceof TypeVariable) ? ResolvableType.forField(field, source)
- : ResolvableType.forField(field));
- }
- return types;
- }
-
- Set getDefinitions() {
- return Collections.unmodifiableSet(this.definitions);
- }
-
- Field getField(Definition definition) {
- return this.definitionFields.get(definition);
- }
-
-}
diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockBean.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockBean.java
deleted file mode 100644
index c8f8b251b5..0000000000
--- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockBean.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Copyright 2012-2024 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.boot.test.mock.mockito;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Repeatable;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import org.junit.runner.RunWith;
-import org.mockito.Answers;
-import org.mockito.MockSettings;
-
-import org.springframework.context.ApplicationContext;
-import org.springframework.core.annotation.AliasFor;
-import org.springframework.test.context.junit4.SpringRunner;
-
-/**
- * Annotation that can be used to add mocks to a Spring {@link ApplicationContext}. Can be
- * used as a class level annotation or on fields in either {@code @Configuration} classes,
- * or test classes that are {@link RunWith @RunWith} the {@link SpringRunner}.
- *
- * Mocks can be registered by type or by {@link #name() bean name}. When registered by
- * type, any existing single bean of a matching type (including subclasses) in the context
- * will be replaced by the mock. When registered by name, an existing bean can be
- * specifically targeted for replacement by a mock. In either case, if no existing bean is
- * defined a new one will be added. Dependencies that are known to the application context
- * but are not beans (such as those
- * {@link org.springframework.beans.factory.config.ConfigurableListableBeanFactory#registerResolvableDependency(Class, Object)
- * registered directly}) will not be found and a mocked bean will be added to the context
- * alongside the existing dependency.
- *
- * When {@code @MockBean} is used on a field, as well as being registered in the
- * application context, the mock will also be injected into the field. Typical usage might
- * be:
- * This annotation is {@code @Repeatable} and may be specified multiple times when working
- * with Java 8 or contained within an {@link MockBeans @MockBeans} annotation.
- *
- * @author Phillip Webb
- * @since 1.4.0
- * @see MockitoPostProcessor
- * @deprecated since 3.4.0 for removal in 4.0.0 in favor of
- * {@link org.springframework.test.context.bean.override.mockito.MockitoBean}
- */
-@SuppressWarnings("removal")
-@Deprecated(since = "3.4.0", forRemoval = true)
-@Target({ ElementType.TYPE, ElementType.FIELD })
-@Retention(RetentionPolicy.RUNTIME)
-@Documented
-@Repeatable(MockBeans.class)
-public @interface MockBean {
-
- /**
- * The name of the bean to register or replace. If not specified the name will either
- * be generated or, if the mock replaces an existing bean, the existing name will be
- * used.
- * @return the name of the bean
- */
- String name() default "";
-
- /**
- * The classes to mock. This is an alias of {@link #classes()} which can be used for
- * brevity if no other attributes are defined. See {@link #classes()} for details.
- * @return the classes to mock
- */
- @AliasFor("classes")
- Class>[] value() default {};
-
- /**
- * The classes to mock. Each class specified here will result in a mock being created
- * and registered with the application context. Classes can be omitted when the
- * annotation is used on a field.
- *
- * When {@code @MockBean} also defines a {@code name} this attribute can only contain
- * a single value.
- *
- * If this is the only specified attribute consider using the {@code value} alias
- * instead.
- * @return the classes to mock
- */
- @AliasFor("value")
- Class>[] classes() default {};
-
- /**
- * Any extra interfaces that should also be declared on the mock. See
- * {@link MockSettings#extraInterfaces(Class...)} for details.
- * @return any extra interfaces
- */
- Class>[] extraInterfaces() default {};
-
- /**
- * The {@link Answers} type to use on the mock.
- * @return the answer type
- */
- Answers answer() default Answers.RETURNS_DEFAULTS;
-
- /**
- * If the generated mock is serializable. See {@link MockSettings#serializable()} for
- * details.
- * @return if the mock is serializable
- */
- boolean serializable() default false;
-
- /**
- * The reset mode to apply to the mock bean. The default is {@link MockReset#AFTER}
- * meaning that mocks are automatically reset after each test method is invoked.
- * @return the reset mode
- */
- MockReset reset() default MockReset.AFTER;
-
-}
diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockBeans.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockBeans.java
deleted file mode 100644
index 499b8cf8be..0000000000
--- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockBeans.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2012-2024 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.boot.test.mock.mockito;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Container annotation that aggregates several {@link MockBean @MockBean} annotations.
- *
- * Can be used natively, declaring several nested {@link MockBean @MockBean} annotations.
- * Can also be used in conjunction with Java 8's support for repeatable
- * annotations, where {@link MockBean @MockBean} can simply be declared several times
- * on the same {@linkplain ElementType#TYPE type}, implicitly generating this container
- * annotation.
- *
- * @author Phillip Webb
- * @since 1.4.0
- * @deprecated since 3.4.0 for removal in 4.0.0 in favor of
- * {@link org.springframework.test.context.bean.override.mockito.MockitoBean}
- */
-@SuppressWarnings("removal")
-@Deprecated(since = "3.4.0", forRemoval = true)
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-@Documented
-public @interface MockBeans {
-
- /**
- * Return the contained {@link MockBean @MockBean} annotations.
- * @return the mock beans
- */
- MockBean[] value();
-
-}
diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockDefinition.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockDefinition.java
deleted file mode 100644
index 60deee22ff..0000000000
--- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockDefinition.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Copyright 2012-2025 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.boot.test.mock.mockito;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.LinkedHashSet;
-import java.util.Set;
-
-import org.mockito.Answers;
-import org.mockito.MockSettings;
-
-import org.springframework.core.ResolvableType;
-import org.springframework.core.style.ToStringCreator;
-import org.springframework.util.Assert;
-import org.springframework.util.ClassUtils;
-import org.springframework.util.ObjectUtils;
-import org.springframework.util.StringUtils;
-
-import static org.mockito.Mockito.mock;
-
-/**
- * A complete definition that can be used to create a Mockito mock.
- *
- * @author Phillip Webb
- * @deprecated since 3.4.0 for removal in 4.0.0
- */
-@SuppressWarnings("removal")
-@Deprecated(since = "3.4.0", forRemoval = true)
-class MockDefinition extends Definition {
-
- private static final int MULTIPLIER = 31;
-
- private final ResolvableType typeToMock;
-
- private final Set> extraInterfaces;
-
- private final Answers answer;
-
- private final boolean serializable;
-
- MockDefinition(String name, ResolvableType typeToMock, Class>[] extraInterfaces, Answers answer,
- boolean serializable, MockReset reset, QualifierDefinition qualifier) {
- super(name, reset, false, qualifier);
- Assert.notNull(typeToMock, "'typeToMock' must not be null");
- this.typeToMock = typeToMock;
- this.extraInterfaces = asClassSet(extraInterfaces);
- this.answer = (answer != null) ? answer : Answers.RETURNS_DEFAULTS;
- this.serializable = serializable;
- }
-
- private Set> asClassSet(Class>[] classes) {
- Set> classSet = new LinkedHashSet<>();
- if (classes != null) {
- classSet.addAll(Arrays.asList(classes));
- }
- return Collections.unmodifiableSet(classSet);
- }
-
- /**
- * Return the type that should be mocked.
- * @return the type to mock; never {@code null}
- */
- ResolvableType getTypeToMock() {
- return this.typeToMock;
- }
-
- /**
- * Return the extra interfaces.
- * @return the extra interfaces or an empty set
- */
- Set> getExtraInterfaces() {
- return this.extraInterfaces;
- }
-
- /**
- * Return the answers mode.
- * @return the answers mode; never {@code null}
- */
- Answers getAnswer() {
- return this.answer;
- }
-
- /**
- * Return if the mock is serializable.
- * @return if the mock is serializable
- */
- boolean isSerializable() {
- return this.serializable;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- }
- if (obj == null || obj.getClass() != getClass()) {
- return false;
- }
- MockDefinition other = (MockDefinition) obj;
- boolean result = super.equals(obj);
- result = result && ObjectUtils.nullSafeEquals(this.typeToMock, other.typeToMock);
- result = result && ObjectUtils.nullSafeEquals(this.extraInterfaces, other.extraInterfaces);
- result = result && ObjectUtils.nullSafeEquals(this.answer, other.answer);
- result = result && this.serializable == other.serializable;
- return result;
- }
-
- @Override
- public int hashCode() {
- int result = super.hashCode();
- result = MULTIPLIER * result + ObjectUtils.nullSafeHashCode(this.typeToMock);
- result = MULTIPLIER * result + ObjectUtils.nullSafeHashCode(this.extraInterfaces);
- result = MULTIPLIER * result + ObjectUtils.nullSafeHashCode(this.answer);
- result = MULTIPLIER * result + Boolean.hashCode(this.serializable);
- return result;
- }
-
- @Override
- public String toString() {
- return new ToStringCreator(this).append("name", getName())
- .append("typeToMock", this.typeToMock)
- .append("extraInterfaces", this.extraInterfaces)
- .append("answer", this.answer)
- .append("serializable", this.serializable)
- .append("reset", getReset())
- .toString();
- }
-
- T createMock() {
- return createMock(getName());
- }
-
- @SuppressWarnings("unchecked")
- T createMock(String name) {
- MockSettings settings = MockReset.withSettings(getReset());
- if (StringUtils.hasLength(name)) {
- settings.name(name);
- }
- if (!this.extraInterfaces.isEmpty()) {
- settings.extraInterfaces(ClassUtils.toClassArray(this.extraInterfaces));
- }
- settings.defaultAnswer(this.answer);
- if (this.serializable) {
- settings.serializable();
- }
- return (T) mock(this.typeToMock.resolve(), settings);
- }
-
-}
diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockReset.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockReset.java
deleted file mode 100644
index aa6894de77..0000000000
--- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockReset.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright 2012-2025 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.boot.test.mock.mockito;
-
-import java.util.List;
-
-import org.mockito.MockSettings;
-import org.mockito.MockingDetails;
-import org.mockito.Mockito;
-import org.mockito.listeners.InvocationListener;
-import org.mockito.listeners.MethodInvocationReport;
-import org.mockito.mock.MockCreationSettings;
-
-import org.springframework.util.Assert;
-
-/**
- * Reset strategy used on a mock bean. Usually applied to a mock through the
- * {@link MockBean @MockBean} annotation but can also be directly applied to any mock in
- * the {@code ApplicationContext} using the static methods.
- *
- * @author Phillip Webb
- * @since 1.4.0
- * @see ResetMocksTestExecutionListener
- * @deprecated since 3.4.0 for removal in 4.0.0 in favor of
- * {@link org.springframework.test.context.bean.override.mockito.MockReset}
- */
-@Deprecated(since = "3.4.0", forRemoval = true)
-public enum MockReset {
-
- /**
- * Reset the mock before the test method runs.
- */
- BEFORE,
-
- /**
- * Reset the mock after the test method runs.
- */
- AFTER,
-
- /**
- * Don't reset the mock.
- */
- NONE;
-
- /**
- * Create {@link MockSettings settings} to be used with mocks where reset should occur
- * before each test method runs.
- * @return mock settings
- */
- public static MockSettings before() {
- return withSettings(BEFORE);
- }
-
- /**
- * Create {@link MockSettings settings} to be used with mocks where reset should occur
- * after each test method runs.
- * @return mock settings
- */
- public static MockSettings after() {
- return withSettings(AFTER);
- }
-
- /**
- * Create {@link MockSettings settings} to be used with mocks where a specific reset
- * should occur.
- * @param reset the reset type
- * @return mock settings
- */
- public static MockSettings withSettings(MockReset reset) {
- return apply(reset, Mockito.withSettings());
- }
-
- /**
- * Apply {@link MockReset} to existing {@link MockSettings settings}.
- * @param reset the reset type
- * @param settings the settings
- * @return the configured settings
- */
- public static MockSettings apply(MockReset reset, MockSettings settings) {
- Assert.notNull(settings, "'settings' must not be null");
- if (reset != null && reset != NONE) {
- settings.invocationListeners(new ResetInvocationListener(reset));
- }
- return settings;
- }
-
- /**
- * Get the {@link MockReset} associated with the given mock.
- * @param mock the source mock
- * @return the reset type (never {@code null})
- */
- static MockReset get(Object mock) {
- MockReset reset = MockReset.NONE;
- MockingDetails mockingDetails = Mockito.mockingDetails(mock);
- if (mockingDetails.isMock()) {
- MockCreationSettings> settings = mockingDetails.getMockCreationSettings();
- List listeners = settings.getInvocationListeners();
- for (Object listener : listeners) {
- if (listener instanceof ResetInvocationListener resetInvocationListener) {
- reset = resetInvocationListener.getReset();
- }
- }
- }
- return reset;
- }
-
- /**
- * Dummy {@link InvocationListener} used to hold the {@link MockReset} value.
- */
- private static class ResetInvocationListener implements InvocationListener {
-
- private final MockReset reset;
-
- ResetInvocationListener(MockReset reset) {
- this.reset = reset;
- }
-
- MockReset getReset() {
- return this.reset;
- }
-
- @Override
- public void reportInvocation(MethodInvocationReport methodInvocationReport) {
- }
-
- }
-
-}
diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockitoBeans.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockitoBeans.java
deleted file mode 100644
index d1f201e092..0000000000
--- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockitoBeans.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2012-2024 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.boot.test.mock.mockito;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * Beans created using Mockito.
- *
- * @author Andy Wilkinson
- */
-class MockitoBeans implements Iterable