# Deprecated API

## Contents

- Terminally Deprecated
- Classes
- Methods
- Constructors

Terminally Deprecated Elements
Element
Description
org.springframework.test.context.aot.AotContextLoader.loadContextForAotProcessing(MergedContextConfiguration)
as of Spring Framework 6.2.4, in favor of `AotContextLoader.loadContextForAotProcessing(MergedContextConfiguration, RuntimeHints)`; to be removed in Spring Framework 8.0
org.springframework.test.context.bean.override.BeanOverrideHandler(Field, ResolvableType, String, BeanOverrideStrategy)
As of Spring Framework 6.2.6, in favor of `BeanOverrideHandler(Field, ResolvableType, String, String, BeanOverrideStrategy)`
org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContextForAotProcessing(MergedContextConfiguration)
as of Spring Framework 6.2.4, in favor of `AbstractDelegatingSmartContextLoader.loadContextForAotProcessing(MergedContextConfiguration, RuntimeHints)`; to be removed in Spring Framework 8.0
org.springframework.test.context.support.AbstractGenericContextLoader.loadContextForAotProcessing(MergedContextConfiguration)
as of Spring Framework 6.2.4, in favor of `AbstractGenericContextLoader.loadContextForAotProcessing(MergedContextConfiguration, RuntimeHints)`; to be removed in Spring Framework 8.0
org.springframework.test.context.web.AbstractGenericWebContextLoader.loadContextForAotProcessing(MergedContextConfiguration)
as of Spring Framework 6.2.4, in favor of `AbstractGenericWebContextLoader.loadContextForAotProcessing(MergedContextConfiguration, RuntimeHints)`; to be removed in Spring Framework 8.0
org.springframework.test.http.HttpHeadersAssert.doesNotContainsHeaders(String...)
in favor of `HttpHeadersAssert.doesNotContainHeaders(String...)`
org.springframework.test.util.JsonPathExpectationsHelper(String, Object...)
in favor of calling `String.formatted(Object...)` upfront
org.springframework.test.web.reactive.server.ExchangeResult.getRawStatusCode()
in favor of `ExchangeResult.getStatus()`, for removal in 7.0
org.springframework.test.web.reactive.server.JsonPathAssertions.value(Consumer<T>, Class<T>)
in favor of `JsonPathAssertions.value(Class, Consumer)`
org.springframework.test.web.reactive.server.JsonPathAssertions.value(Matcher<? super T>, Class<T>)
in favor of `JsonPathAssertions.value(Class, Matcher)`
org.springframework.test.web.reactive.server.WebTestClient.BodyContentSpec.jsonPath(String, Object...)
in favor of calling `String.formatted(Object...)` upfront

Deprecated Classes
Class
Description
org.springframework.test.util.JsonExpectationsHelper
in favor of using `JSONAssert` directly or the `JsonComparator` abstraction

Deprecated Methods
Method
Description
org.springframework.mock.http.server.reactive.MockServerHttpRequest.method(String, String, Object...)
as of Spring Framework 6.0 in favor of `MockServerHttpRequest.method(HttpMethod, String, Object...)`
org.springframework.mock.web.MockPageContext.getExpressionEvaluator()
org.springframework.mock.web.MockPageContext.getVariableResolver()
org.springframework.mock.web.reactive.function.server.MockServerRequest.methodName()
org.springframework.test.context.aot.AotContextLoader.loadContextForAotProcessing(MergedContextConfiguration)
as of Spring Framework 6.2.4, in favor of `AotContextLoader.loadContextForAotProcessing(MergedContextConfiguration, RuntimeHints)`; to be removed in Spring Framework 8.0
org.springframework.test.context.ContextLoader.loadContext(String...)
as of Spring Framework 6.0, in favor of methods defined in the `SmartContextLoader` SPI
org.springframework.test.context.ContextLoader.processLocations(Class<?>, String...)
as of Spring Framework 6.0, in favor of methods defined in the `SmartContextLoader` SPI
org.springframework.test.context.MergedContextConfiguration.getPropertySourceLocations()
since 6.1 in favor of `MergedContextConfiguration.getPropertySourceDescriptors()`
org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContextForAotProcessing(MergedContextConfiguration)
as of Spring Framework 6.2.4, in favor of `AbstractDelegatingSmartContextLoader.loadContextForAotProcessing(MergedContextConfiguration, RuntimeHints)`; to be removed in Spring Framework 8.0
org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(String...)
as of Spring Framework 6.0, in favor of `AbstractGenericContextLoader.loadContext(MergedContextConfiguration)`
org.springframework.test.context.support.AbstractGenericContextLoader.loadContextForAotProcessing(MergedContextConfiguration)
as of Spring Framework 6.2.4, in favor of `AbstractGenericContextLoader.loadContextForAotProcessing(MergedContextConfiguration, RuntimeHints)`; to be removed in Spring Framework 8.0
org.springframework.test.context.web.AbstractGenericWebContextLoader.loadContextForAotProcessing(MergedContextConfiguration)
as of Spring Framework 6.2.4, in favor of `AbstractGenericWebContextLoader.loadContextForAotProcessing(MergedContextConfiguration, RuntimeHints)`; to be removed in Spring Framework 8.0
org.springframework.test.http.HttpHeadersAssert.doesNotContainsHeaders(String...)
in favor of `HttpHeadersAssert.doesNotContainHeaders(String...)`
org.springframework.test.web.client.match.ContentRequestMatchers.json(String, boolean)
in favor of `ContentRequestMatchers.json(String, JsonCompareMode)`
org.springframework.test.web.reactive.server.ExchangeResult.getRawStatusCode()
in favor of `ExchangeResult.getStatus()`, for removal in 7.0
org.springframework.test.web.reactive.server.JsonPathAssertions.value(Consumer<T>, Class<T>)
in favor of `JsonPathAssertions.value(Class, Consumer)`
org.springframework.test.web.reactive.server.JsonPathAssertions.value(Matcher<? super T>, Class<T>)
in favor of `JsonPathAssertions.value(Class, Matcher)`
org.springframework.test.web.reactive.server.WebTestClient.BodyContentSpec.json(String, boolean)
in favor of `WebTestClient.BodyContentSpec.json(String, JsonCompareMode)`
org.springframework.test.web.reactive.server.WebTestClient.BodyContentSpec.jsonPath(String, Object...)
in favor of calling `String.formatted(Object...)` upfront
org.springframework.test.web.reactive.server.WebTestClient.Builder.exchangeStrategies(Consumer<ExchangeStrategies.Builder>)
as of 5.1.13 in favor of `WebTestClient.Builder.codecs(Consumer)`
org.springframework.test.web.reactive.server.WebTestClient.RequestBodySpec.syncBody(Object)
as of Spring Framework 5.2 in favor of `WebTestClient.RequestBodySpec.bodyValue(Object)`
org.springframework.test.web.servlet.client.MockMvcWebTestClient.ControllerSpec.useTrailingSlashPatternMatch(boolean)
as of 6.0, see `PathPatternParser.setMatchOptionalTrailingSeparator(boolean)`
org.springframework.test.web.servlet.request.MockMvcRequestBuilders.request(String, URI)
in favor of `MockMvcRequestBuilders.request(HttpMethod, URI)`
org.springframework.test.web.servlet.result.ContentResultMatchers.json(String, boolean)
in favor of `ContentResultMatchers.json(String, JsonCompareMode)`
org.springframework.test.web.servlet.result.StatusResultMatchers.isCheckpoint()
in favor of `StatusResultMatchers.isEarlyHints()`
org.springframework.test.web.servlet.result.StatusResultMatchers.isDestinationLocked()
matching the deprecation of `HttpStatus.DESTINATION_LOCKED`
org.springframework.test.web.servlet.result.StatusResultMatchers.isInsufficientSpaceOnResource()
matching the deprecation of `HttpStatus.INSUFFICIENT_SPACE_ON_RESOURCE`
org.springframework.test.web.servlet.result.StatusResultMatchers.isMethodFailure()
matching the deprecation of `HttpStatus.METHOD_FAILURE`
org.springframework.test.web.servlet.result.StatusResultMatchers.isMovedTemporarily()
in favor of `StatusResultMatchers.isFound()`
org.springframework.test.web.servlet.result.StatusResultMatchers.isRequestEntityTooLarge()
matching the deprecation of `HttpStatus.REQUEST_ENTITY_TOO_LARGE`
org.springframework.test.web.servlet.result.StatusResultMatchers.isRequestUriTooLong()
matching the deprecation of `HttpStatus.REQUEST_URI_TOO_LONG`
org.springframework.test.web.servlet.result.StatusResultMatchers.isUseProxy()
matching the deprecation of `HttpStatus.USE_PROXY`
org.springframework.test.web.servlet.ResultMatcher.matchAll(ResultMatcher...)
as of Spring Framework 5.3.10, in favor of `ResultActions.andExpectAll(ResultMatcher...)`
org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder.setUseSuffixPatternMatch(boolean)
as of 5.2.4. See class-level note in `RequestMappingHandlerMapping` on the deprecation of path extension config options.
org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder.setUseTrailingSlashPatternMatch(boolean)
as of 6.0, see `PathPatternParser.setMatchOptionalTrailingSeparator(boolean)`

Deprecated Constructors
Constructor
Description
org.springframework.test.context.bean.override.BeanOverrideHandler(Field, ResolvableType, String, BeanOverrideStrategy)
As of Spring Framework 6.2.6, in favor of `BeanOverrideHandler(Field, ResolvableType, String, String, BeanOverrideStrategy)`
org.springframework.test.context.MergedContextConfiguration(Class<?>, String[], Class<?>[], Set<Class<? extends ApplicationContextInitializer<?>>>, String[], String[], String[], Set<ContextCustomizer>, ContextLoader, CacheAwareContextLoaderDelegate, MergedContextConfiguration)
since 6.1 in favor of `MergedContextConfiguration(Class, String[], Class[], Set, String[], List, String[], Set, ContextLoader, CacheAwareContextLoaderDelegate, MergedContextConfiguration)`
org.springframework.test.context.MergedContextConfiguration(Class<?>, String[], Class<?>[], Set<Class<? extends ApplicationContextInitializer<?>>>, String[], String[], String[], ContextLoader, CacheAwareContextLoaderDelegate, MergedContextConfiguration)
since 6.1 in favor of `MergedContextConfiguration(Class, String[], Class[], Set, String[], List, String[], Set, ContextLoader, CacheAwareContextLoaderDelegate, MergedContextConfiguration)`
org.springframework.test.context.web.WebMergedContextConfiguration(Class<?>, String[], Class<?>[], Set<Class<? extends ApplicationContextInitializer<?>>>, String[], String[], String[], String, ContextLoader, CacheAwareContextLoaderDelegate, MergedContextConfiguration)
since 6.1 in favor of `WebMergedContextConfiguration(Class, String[], Class[], Set, String[], List, String[], Set, String, ContextLoader, CacheAwareContextLoaderDelegate, MergedContextConfiguration)`
org.springframework.test.context.web.WebMergedContextConfiguration(Class<?>, String[], Class<?>[], Set<Class<? extends ApplicationContextInitializer<?>>>, String[], String[], String[], Set<ContextCustomizer>, String, ContextLoader, CacheAwareContextLoaderDelegate, MergedContextConfiguration)
since 6.1 in favor of `WebMergedContextConfiguration(Class, String[], Class[], Set, String[], List, String[], Set, String, ContextLoader, CacheAwareContextLoaderDelegate, MergedContextConfiguration)`
org.springframework.test.util.JsonPathExpectationsHelper(String, Object...)
in favor of calling `String.formatted(Object...)` upfront