Index
All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form
A
- AbstractContextLoader - Class in org.springframework.test.context.support
-
Abstract application context loader that provides a basis for all concrete implementations of the
ContextLoader
SPI. - AbstractContextLoader() - Constructor for class org.springframework.test.context.support.AbstractContextLoader
- AbstractDelegatingSmartContextLoader - Class in org.springframework.test.context.support
-
AbstractDelegatingSmartContextLoader
serves as an abstract base class for implementations of theSmartContextLoader
SPI that delegate to a set of candidate SmartContextLoaders (i.e., one that supports XML configuration files or Groovy scripts and one that supports annotated classes) to determine which context loader is appropriate for a given test class's configuration. - AbstractDelegatingSmartContextLoader() - Constructor for class org.springframework.test.context.support.AbstractDelegatingSmartContextLoader
- AbstractDirtiesContextTestExecutionListener - Class in org.springframework.test.context.support
-
Abstract base class for
TestExecutionListener
implementations that provide support for marking theApplicationContext
associated with a test as dirty for both test classes and test methods annotated with the@DirtiesContext
annotation. - AbstractDirtiesContextTestExecutionListener() - Constructor for class org.springframework.test.context.support.AbstractDirtiesContextTestExecutionListener
- AbstractGenericContextLoader - Class in org.springframework.test.context.support
-
Abstract, generic extension of
AbstractContextLoader
that loads aGenericApplicationContext
. - AbstractGenericContextLoader() - Constructor for class org.springframework.test.context.support.AbstractGenericContextLoader
- AbstractGenericWebContextLoader - Class in org.springframework.test.context.web
-
Abstract, generic extension of
AbstractContextLoader
that loads aGenericWebApplicationContext
. - AbstractGenericWebContextLoader() - Constructor for class org.springframework.test.context.web.AbstractGenericWebContextLoader
- AbstractJUnit4SpringContextTests - Class in org.springframework.test.context.junit4
-
Abstract base test class which integrates the Spring TestContext Framework with explicit
ApplicationContext
testing support in a JUnit 4 environment. - AbstractJUnit4SpringContextTests() - Constructor for class org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests
- AbstractMockMvcBuilder<B extends AbstractMockMvcBuilder<B>> - Class in org.springframework.test.web.servlet.setup
-
Abstract implementation of
MockMvcBuilder
with common methods for configuring filters, default request properties, global expectations and global result actions. - AbstractMockMvcBuilder() - Constructor for class org.springframework.test.web.servlet.setup.AbstractMockMvcBuilder
- AbstractRequestExpectationManager - Class in org.springframework.test.web.client
-
Base class for
RequestExpectationManager
implementations responsible for storing expectations and actual requests, and checking for unsatisfied expectations at the end. - AbstractRequestExpectationManager() - Constructor for class org.springframework.test.web.client.AbstractRequestExpectationManager
- AbstractRequestExpectationManager.RequestExpectationGroup - Class in org.springframework.test.web.client
-
Helper class to manage a group of remaining expectations.
- AbstractTestContextBootstrapper - Class in org.springframework.test.context.support
-
Abstract implementation of the
TestContextBootstrapper
interface which provides most of the behavior required by a bootstrapper. - AbstractTestContextBootstrapper() - Constructor for class org.springframework.test.context.support.AbstractTestContextBootstrapper
- AbstractTestExecutionListener - Class in org.springframework.test.context.support
-
Abstract ordered implementation of the
TestExecutionListener
API. - AbstractTestExecutionListener() - Constructor for class org.springframework.test.context.support.AbstractTestExecutionListener
- AbstractTestNGSpringContextTests - Class in org.springframework.test.context.testng
-
Abstract base test class which integrates the Spring TestContext Framework with explicit
ApplicationContext
testing support in a TestNG environment. - AbstractTestNGSpringContextTests() - Constructor for class org.springframework.test.context.testng.AbstractTestNGSpringContextTests
-
Construct a new
AbstractTestNGSpringContextTests
instance and initialize the internalTestContextManager
for the current test class. - AbstractTransactionalJUnit4SpringContextTests - Class in org.springframework.test.context.junit4
-
Abstract transactional extension of
AbstractJUnit4SpringContextTests
which adds convenience functionality for JDBC access. - AbstractTransactionalJUnit4SpringContextTests() - Constructor for class org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests
- AbstractTransactionalTestNGSpringContextTests - Class in org.springframework.test.context.testng
-
Abstract transactional extension of
AbstractTestNGSpringContextTests
which adds convenience functionality for JDBC access. - AbstractTransactionalTestNGSpringContextTests() - Constructor for class org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests
- accept(String...) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Set the
Accept
header using raw String values, possibly not even well-formed (for testing purposes). - accept(MediaType...) - Method in interface org.springframework.mock.http.server.reactive.MockServerHttpRequest.BaseBuilder
-
Set the list of acceptable media types, as specified by the
Accept
header. - accept(MediaType...) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.RequestHeadersSpec
-
Set the list of acceptable media types, as specified by the
Accept
header. - accept(MediaType...) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Set the 'Accept' header to the given media type(s).
- acceptCharset(Charset...) - Method in interface org.springframework.mock.http.server.reactive.MockServerHttpRequest.BaseBuilder
-
Set the list of acceptable charsets, as specified by the
Accept-Charset
header. - acceptCharset(Charset...) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.RequestHeadersSpec
-
Set the list of acceptable charsets, as specified by the
Accept-Charset
header. - acceptLanguageAsLocales(Locale...) - Method in interface org.springframework.mock.http.server.reactive.MockServerHttpRequest.BaseBuilder
-
Set the list of acceptable locales, as specified by the
Accept-Languages
header. - access() - Method in class org.springframework.mock.web.MockHttpSession
- ACTIVATE_LISTENER - Static variable in class org.springframework.test.context.web.ServletTestExecutionListener
-
Attribute name for a
TestContext
attribute which indicates that theServletTestExecutionListener
should be activated. - ActiveProfiles - Annotation Interface in org.springframework.test.context
-
ActiveProfiles
is a class-level annotation that is used to declare which active bean definition profiles should be used when loading anApplicationContext
for test classes. - ActiveProfilesResolver - Interface in org.springframework.test.context
-
Strategy interface for programmatically resolving which active bean definition profiles should be used when loading an
ApplicationContext
for a test class. - add(String, Supplier<Object>) - Method in interface org.springframework.test.context.DynamicPropertyRegistry
-
Add a
Supplier
for the given property name to this registry. - addAllExpectations(Collection<RequestExpectation>) - Method in class org.springframework.test.web.client.AbstractRequestExpectationManager.RequestExpectationGroup
- addCookie(Cookie) - Method in class org.springframework.mock.web.MockHttpServletResponse
- addDateHeader(String, long) - Method in class org.springframework.mock.web.MockHttpServletResponse
- addDispatcherServletCustomizer(DispatcherServletCustomizer) - Method in class org.springframework.test.web.servlet.setup.AbstractMockMvcBuilder
- addDispatcherServletCustomizer(DispatcherServletCustomizer) - Method in interface org.springframework.test.web.servlet.setup.ConfigurableMockMvcBuilder
-
A more advanced variant of
ConfigurableMockMvcBuilder.dispatchOptions(boolean)
that allows customizing anyDispatcherServlet
property. - addDispatchHandler(Runnable) - Method in class org.springframework.mock.web.MockAsyncContext
- addFile(MultipartFile) - Method in class org.springframework.mock.web.MockMultipartHttpServletRequest
-
Add a file to this request.
- addFilter(Filter, String...) - Method in class org.springframework.test.web.servlet.setup.AbstractMockMvcBuilder
- addFilter(Filter, String...) - Method in interface org.springframework.test.web.servlet.setup.ConfigurableMockMvcBuilder
-
Add a filter mapped to specific patterns.
- addFilter(Filter, String, Map<String, String>, EnumSet<DispatcherType>, String...) - Method in class org.springframework.test.web.servlet.setup.AbstractMockMvcBuilder
- addFilter(Filter, String, Map<String, String>, EnumSet<DispatcherType>, String...) - Method in interface org.springframework.test.web.servlet.setup.ConfigurableMockMvcBuilder
-
Add a filter that will be initialized via
Filter.init(FilterConfig)
with the given init parameters, and will also apply only to requests that match the given dispatcher types and URL patterns. - addFilter(String, Filter) - Method in class org.springframework.mock.web.MockServletContext
- addFilter(String, Class<? extends Filter>) - Method in class org.springframework.mock.web.MockServletContext
- addFilter(String, String) - Method in class org.springframework.mock.web.MockServletContext
- addFilters(Filter...) - Method in class org.springframework.test.web.servlet.setup.AbstractMockMvcBuilder
- addFilters(Filter...) - Method in interface org.springframework.test.web.servlet.setup.ConfigurableMockMvcBuilder
-
Add filters mapped to all requests.
- addHeader(String, Object) - Method in class org.springframework.mock.web.MockHttpServletRequest
-
Add an HTTP header entry for the given name.
- addHeader(String, String) - Method in class org.springframework.mock.web.MockHttpServletResponse
- addIncludedUrl(String) - Method in class org.springframework.mock.web.MockHttpServletResponse
- addInitParameter(String, String) - Method in class org.springframework.mock.web.MockFilterConfig
- addInitParameter(String, String) - Method in class org.springframework.mock.web.MockServletConfig
- addInitParameter(String, String) - Method in class org.springframework.mock.web.MockServletContext
- addInlinedPropertiesToEnvironment(ConfigurableApplicationContext, String...) - Static method in class org.springframework.test.context.support.TestPropertySourceUtils
-
Add the given inlined properties to the
Environment
of the suppliedcontext
. - addInlinedPropertiesToEnvironment(ConfigurableEnvironment, String...) - Static method in class org.springframework.test.context.support.TestPropertySourceUtils
-
Add the given inlined properties (in the form of key-value pairs) to the supplied
environment
. - addInterceptors(HandlerInterceptor...) - Method in class org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder
-
Add interceptors mapped to all incoming requests.
- addIntHeader(String, int) - Method in class org.springframework.mock.web.MockHttpServletResponse
- addJspFile(String, String) - Method in class org.springframework.mock.web.MockServletContext
- addListener(AsyncListener) - Method in class org.springframework.mock.web.MockAsyncContext
- addListener(AsyncListener, ServletRequest, ServletResponse) - Method in class org.springframework.mock.web.MockAsyncContext
- addListener(Class<? extends EventListener>) - Method in class org.springframework.mock.web.MockServletContext
- addListener(String) - Method in class org.springframework.mock.web.MockServletContext
- addListener(T) - Method in class org.springframework.mock.web.MockServletContext
- addMappedInterceptors(String[], HandlerInterceptor...) - Method in class org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder
-
Add interceptors mapped to a set of path patterns.
- addMimeType(String, MediaType) - Method in class org.springframework.mock.web.MockServletContext
-
Adds a mime type mapping for use by
MockServletContext.getMimeType(String)
. - addParameter(String, String) - Method in class org.springframework.mock.web.MockHttpServletRequest
-
Add a single value for the specified HTTP parameter.
- addParameter(String, String...) - Method in class org.springframework.mock.web.MockHttpServletRequest
-
Add an array of values for the specified HTTP parameter.
- addParameters(Map<String, ?>) - Method in class org.springframework.mock.web.MockHttpServletRequest
-
Add all provided parameters without replacing any existing values.
- addPart(Part) - Method in class org.springframework.mock.web.MockHttpServletRequest
- addPlaceholderValue(String, String) - Method in class org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder
-
In a standalone setup there is no support for placeholder values embedded in request mappings.
- addPreferredLocale(Locale) - Method in class org.springframework.mock.web.MockHttpServletRequest
-
Add a new preferred locale, before any existing locales.
- addPropertiesFilesToEnvironment(ConfigurableApplicationContext, String...) - Static method in class org.springframework.test.context.support.TestPropertySourceUtils
-
Add the
Properties
files from the given resourcelocations
to theEnvironment
of the suppliedcontext
. - addPropertiesFilesToEnvironment(ConfigurableEnvironment, ResourceLoader, String...) - Static method in class org.springframework.test.context.support.TestPropertySourceUtils
- addPropertySourcesToEnvironment(ConfigurableApplicationContext, List<PropertySourceDescriptor>) - Static method in class org.springframework.test.context.support.TestPropertySourceUtils
-
Add property sources for the given
descriptors
to theEnvironment
of the suppliedcontext
. - addPropertySourcesToEnvironment(ConfigurableEnvironment, ResourceLoader, List<PropertySourceDescriptor>) - Static method in class org.springframework.test.context.support.TestPropertySourceUtils
-
Add property sources for the given
descriptors
to the suppliedenvironment
. - addServlet(String, Servlet) - Method in class org.springframework.mock.web.MockServletContext
- addServlet(String, Class<? extends Servlet>) - Method in class org.springframework.mock.web.MockServletContext
- addServlet(String, String) - Method in class org.springframework.mock.web.MockServletContext
- addUserRole(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
- AFTER_CLASS - Enum constant in enum class org.springframework.test.annotation.DirtiesContext.ClassMode
-
The associated
ApplicationContext
will be marked as dirty after the test class. - AFTER_EACH_TEST_METHOD - Enum constant in enum class org.springframework.test.annotation.DirtiesContext.ClassMode
-
The associated
ApplicationContext
will be marked as dirty after each test method in the class. - AFTER_METHOD - Enum constant in enum class org.springframework.test.annotation.DirtiesContext.MethodMode
-
The associated
ApplicationContext
will be marked as dirty after the corresponding test method. - AFTER_TEST_CLASS - Enum constant in enum class org.springframework.test.context.jdbc.Sql.ExecutionPhase
-
The configured SQL scripts and statements will be executed once per test class after all test methods have run.
- AFTER_TEST_METHOD - Enum constant in enum class org.springframework.test.context.jdbc.Sql.ExecutionPhase
-
The configured SQL scripts and statements will be executed after the corresponding test method.
- afterAll(ExtensionContext) - Method in class org.springframework.test.context.junit.jupiter.SpringExtension
-
Delegates to
TestContextManager.afterTestClass()
. - afterConfigureAdded(WebTestClient.MockServerSpec<?>) - Method in interface org.springframework.test.web.reactive.server.MockServerConfigurer
-
Invoked immediately, i.e.
- afterConfigurerAdded(WebTestClient.Builder, WebHttpHandlerBuilder, ClientHttpConnector) - Method in interface org.springframework.test.web.reactive.server.WebTestClientConfigurer
-
Use methods on
WebTestClient.Builder
to modify test client settings. - afterConfigurerAdded(ConfigurableMockMvcBuilder<?>) - Method in interface org.springframework.test.web.servlet.setup.MockMvcConfigurer
-
Invoked immediately when this
MockMvcConfigurer
is added viaConfigurableMockMvcBuilder.apply(org.springframework.test.web.servlet.setup.MockMvcConfigurer)
. - afterConfigurerAdded(ConfigurableMockMvcBuilder<?>) - Method in class org.springframework.test.web.servlet.setup.MockMvcConfigurerAdapter
- afterConfigurerAdded(ConfigurableMockMvcBuilder<?>) - Method in class org.springframework.test.web.servlet.setup.SharedHttpSessionConfigurer
- afterEach(ExtensionContext) - Method in class org.springframework.test.context.junit.jupiter.SpringExtension
- afterExpectationsDeclared() - Method in class org.springframework.test.web.client.AbstractRequestExpectationManager
-
Invoked at the time of the first actual request, which effectively means the expectations declaration phase is over.
- afterExpectationsDeclared() - Method in class org.springframework.test.web.client.SimpleRequestExpectationManager
- afterExpectationsDeclared() - Method in class org.springframework.test.web.client.UnorderedRequestExpectationManager
- afterTestClass() - Method in class org.springframework.test.context.TestContextManager
-
Hook for post-processing a test class after execution of all tests within the class.
- afterTestClass(TestContext) - Method in class org.springframework.test.context.event.EventPublishingTestExecutionListener
- afterTestClass(TestContext) - Method in class org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener
-
Execute SQL scripts configured via
@Sql
for the suppliedTestContext
once per test class after all test methods have been run. - afterTestClass(TestContext) - Method in class org.springframework.test.context.support.AbstractTestExecutionListener
-
The default implementation is empty.
- afterTestClass(TestContext) - Method in class org.springframework.test.context.support.DirtiesContextTestExecutionListener
-
If the test class of the supplied test context is annotated with
@DirtiesContext
and the class mode is set toAFTER_CLASS
, the application context of the test context will be marked as dirty, and theREINJECT_DEPENDENCIES_ATTRIBUTE
in the test context will be set totrue
. - afterTestClass(TestContext) - Method in interface org.springframework.test.context.TestExecutionListener
-
Post-processes a test class after execution of all tests within the class.
- AfterTestClass - Annotation Interface in org.springframework.test.context.event.annotation
-
@EventListener
annotation used to consume anAfterTestClassEvent
published by theEventPublishingTestExecutionListener
. - AfterTestClassEvent - Class in org.springframework.test.context.event
-
TestContextEvent
published by theEventPublishingTestExecutionListener
whenTestExecutionListener.afterTestClass(TestContext)
is invoked. - AfterTestClassEvent(TestContext) - Constructor for class org.springframework.test.context.event.AfterTestClassEvent
- afterTestExecution(Object, Method, Throwable) - Method in class org.springframework.test.context.TestContextManager
-
Hook for post-processing a test immediately after execution of the test method in the supplied test context — for example, for timing or logging purposes.
- afterTestExecution(ExtensionContext) - Method in class org.springframework.test.context.junit.jupiter.SpringExtension
- afterTestExecution(TestContext) - Method in class org.springframework.test.context.event.EventPublishingTestExecutionListener
- afterTestExecution(TestContext) - Method in class org.springframework.test.context.support.AbstractTestExecutionListener
-
The default implementation is empty.
- afterTestExecution(TestContext) - Method in interface org.springframework.test.context.TestExecutionListener
-
Post-processes a test immediately after execution of the test method in the supplied test context — for example, for timing or logging purposes.
- AfterTestExecution - Annotation Interface in org.springframework.test.context.event.annotation
-
@EventListener
annotation used to consume anAfterTestExecutionEvent
published by theEventPublishingTestExecutionListener
. - AfterTestExecutionEvent - Class in org.springframework.test.context.event
-
TestContextEvent
published by theEventPublishingTestExecutionListener
whenTestExecutionListener.afterTestExecution(TestContext)
is invoked. - AfterTestExecutionEvent(TestContext) - Constructor for class org.springframework.test.context.event.AfterTestExecutionEvent
- afterTestMethod(Object, Method, Throwable) - Method in class org.springframework.test.context.TestContextManager
-
Hook for post-processing a test after execution of after lifecycle callbacks of the underlying test framework — for example, tearing down test fixtures, ending a transaction, etc.
- afterTestMethod(TestContext) - Method in class org.springframework.test.context.event.ApplicationEventsTestExecutionListener
- afterTestMethod(TestContext) - Method in class org.springframework.test.context.event.EventPublishingTestExecutionListener
- afterTestMethod(TestContext) - Method in class org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener
-
Execute SQL scripts configured via
@Sql
for the suppliedTestContext
after the current test method. - afterTestMethod(TestContext) - Method in class org.springframework.test.context.support.AbstractTestExecutionListener
-
The default implementation is empty.
- afterTestMethod(TestContext) - Method in class org.springframework.test.context.support.DirtiesContextTestExecutionListener
-
If the current test method of the supplied test context is annotated with
@DirtiesContext
and the method mode is set toAFTER_METHOD
, or if the test class is annotated with@DirtiesContext
and the class mode is set toAFTER_EACH_TEST_METHOD
, the application context of the test context will be marked as dirty and theREINJECT_DEPENDENCIES_ATTRIBUTE
in the test context will be set totrue
. - afterTestMethod(TestContext) - Method in interface org.springframework.test.context.TestExecutionListener
-
Post-processes a test after execution of after lifecycle callbacks of the underlying test framework — for example, by tearing down test fixtures.
- afterTestMethod(TestContext) - Method in class org.springframework.test.context.transaction.TransactionalTestExecutionListener
-
If a transaction is currently active for the supplied test context, this method will end the transaction and run
@AfterTransaction
methods. - afterTestMethod(TestContext) - Method in class org.springframework.test.context.web.ServletTestExecutionListener
-
If the
ServletTestExecutionListener.RESET_REQUEST_CONTEXT_HOLDER_ATTRIBUTE
in the suppliedTestContext
has a value ofBoolean.TRUE
, this method will (1) clean up thread-local state after each test method by resetting Spring Web'sRequestContextHolder
and (2) ensure that new mocks are injected into the test instance for subsequent tests by setting theDependencyInjectionTestExecutionListener.REINJECT_DEPENDENCIES_ATTRIBUTE
in the test context totrue
. - AfterTestMethod - Annotation Interface in org.springframework.test.context.event.annotation
-
@EventListener
annotation used to consume anAfterTestMethodEvent
published by theEventPublishingTestExecutionListener
. - AfterTestMethodEvent - Class in org.springframework.test.context.event
-
TestContextEvent
published by theEventPublishingTestExecutionListener
whenTestExecutionListener.afterTestMethod(TestContext)
is invoked. - AfterTestMethodEvent(TestContext) - Constructor for class org.springframework.test.context.event.AfterTestMethodEvent
- AfterTransaction - Annotation Interface in org.springframework.test.context.transaction
-
Test annotation which indicates that the annotated
void
method should be executed after a transaction is ended for a test method configured to run within a transaction via Spring's@Transactional
annotation. - ALL - Enum constant in enum class org.springframework.test.context.TestConstructor.AutowireMode
-
All test constructor parameters will be autowired as if the constructor itself were annotated with
@Autowired
,@jakarta.inject.Inject
, or@javax.inject.Inject
. - alwaysDo(ResultHandler) - Method in class org.springframework.test.web.servlet.setup.AbstractMockMvcBuilder
- alwaysDo(ResultHandler) - Method in interface org.springframework.test.web.servlet.setup.ConfigurableMockMvcBuilder
-
Define a global action that should always be applied to every response.
- alwaysExpect(ResultMatcher) - Method in interface org.springframework.test.web.servlet.client.MockMvcWebTestClient.MockMvcServerSpec
-
Define a global expectation that should always be applied to every response.
- alwaysExpect(ResultMatcher) - Method in class org.springframework.test.web.servlet.setup.AbstractMockMvcBuilder
- alwaysExpect(ResultMatcher) - Method in interface org.springframework.test.web.servlet.setup.ConfigurableMockMvcBuilder
-
Define a global expectation that should always be applied to every response.
- alwaysUseMockMvc() - Method in class org.springframework.test.web.servlet.htmlunit.MockMvcWebConnectionBuilderSupport
-
Specify that
MockMvc
should always be used regardless of what the request looks like. - andDo(ResultHandler) - Method in interface org.springframework.test.web.servlet.ResultActions
-
Perform a general action.
- andExpect(RequestMatcher) - Method in class org.springframework.test.web.client.DefaultRequestExpectation
- andExpect(RequestMatcher) - Method in interface org.springframework.test.web.client.ResponseActions
-
Add a request expectation.
- andExpect(ResultMatcher) - Method in interface org.springframework.test.web.servlet.ResultActions
-
Perform an expectation.
- andExpectAll(ResultMatcher...) - Method in interface org.springframework.test.web.servlet.ResultActions
-
Perform multiple expectations, with the guarantee that all expectations will be asserted even if one or more expectations fail with an exception.
- andRespond(ResponseCreator) - Method in class org.springframework.test.web.client.DefaultRequestExpectation
- andRespond(ResponseCreator) - Method in interface org.springframework.test.web.client.ResponseActions
-
Define the response.
- andReturn() - Method in interface org.springframework.test.web.servlet.ResultActions
-
Return the result of the executed request for direct access to the results.
- ANNOTATED - Enum constant in enum class org.springframework.test.context.TestConstructor.AutowireMode
-
Each individual test constructor parameter will only be autowired if it is annotated with
@Autowired
,@Qualifier
, or@Value
, or if the constructor itself is annotated with@Autowired
,@jakarta.inject.Inject
, or@javax.inject.Inject
. - AnnotationConfigContextLoader - Class in org.springframework.test.context.support
-
Concrete implementation of
AbstractGenericContextLoader
that loads bean definitions from component classes. - AnnotationConfigContextLoader() - Constructor for class org.springframework.test.context.support.AnnotationConfigContextLoader
- AnnotationConfigContextLoaderUtils - Class in org.springframework.test.context.support
-
Utility methods for
SmartContextLoaders
that deal with component classes (e.g.,@Configuration
classes). - AnnotationConfigContextLoaderUtils() - Constructor for class org.springframework.test.context.support.AnnotationConfigContextLoaderUtils
- AnnotationConfigWebContextLoader - Class in org.springframework.test.context.web
-
Concrete implementation of
AbstractGenericWebContextLoader
that loads bean definitions from annotated classes. - AnnotationConfigWebContextLoader() - Constructor for class org.springframework.test.context.web.AnnotationConfigWebContextLoader
- anything() - Static method in class org.springframework.test.web.client.match.MockRestRequestMatchers
-
Match to any request.
- AopTestUtils - Class in org.springframework.test.util
-
AopTestUtils
is a collection of AOP-related utility methods for use in unit and integration testing scenarios. - AopTestUtils() - Constructor for class org.springframework.test.util.AopTestUtils
- AotContextLoader - Interface in org.springframework.test.context.aot
-
Strategy interface for loading an
ApplicationContext
for build-time AOT processing as well as run-time AOT execution for an integration test managed by the Spring TestContext Framework. - AotTestAttributes - Interface in org.springframework.test.context.aot
-
Holder for metadata specific to ahead-of-time (AOT) support in the Spring TestContext Framework.
- AotTestContextInitializers - Class in org.springframework.test.context.aot
-
AotTestContextInitializers
provides mappings from test classes to AOT-optimized context initializers. - AotTestContextInitializers() - Constructor for class org.springframework.test.context.aot.AotTestContextInitializers
- AotTestExecutionListener - Interface in org.springframework.test.context.aot
-
AotTestExecutionListener
is an extension of theTestExecutionListener
SPI that allows a listener to optionally provide ahead-of-time (AOT) support. - applicationContext - Variable in class org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests
-
The
ApplicationContext
that was injected into this test instance viaAbstractJUnit4SpringContextTests.setApplicationContext(ApplicationContext)
. - applicationContext - Variable in class org.springframework.test.context.testng.AbstractTestNGSpringContextTests
-
The
ApplicationContext
that was injected into this test instance viaAbstractTestNGSpringContextTests.setApplicationContext(ApplicationContext)
. - ApplicationContextFailureProcessor - Interface in org.springframework.test.context
-
Strategy for components that process failures related to application contexts within the Spring TestContext Framework.
- ApplicationEvents - Interface in org.springframework.test.context.event
-
ApplicationEvents
encapsulates all application events that were fired during the execution of a single test method. - ApplicationEventsHolder - Class in org.springframework.test.context.event
-
Holder class to expose the application events published during the execution of a test in the form of a thread-bound
ApplicationEvents
object. - ApplicationEventsTestExecutionListener - Class in org.springframework.test.context.event
-
TestExecutionListener
which provides support forApplicationEvents
. - ApplicationEventsTestExecutionListener() - Constructor for class org.springframework.test.context.event.ApplicationEventsTestExecutionListener
- apply(Statement, Description) - Method in class org.springframework.test.context.junit4.rules.SpringClassRule
-
Apply class-level features of the Spring TestContext Framework to the supplied
base
statement. - apply(Statement, FrameworkMethod, Object) - Method in class org.springframework.test.context.junit4.rules.SpringMethodRule
-
Apply instance-level and method-level features of the Spring TestContext Framework to the supplied
base
statement. - apply(MockServerConfigurer) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.MockServerSpec
-
Shortcut for pre-packaged customizations to the mock server setup.
- apply(WebTestClientConfigurer) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.Builder
-
Apply the given configurer to this builder instance.
- apply(MockMvcConfigurer) - Method in interface org.springframework.test.web.servlet.client.MockMvcWebTestClient.MockMvcServerSpec
-
Add a
MockMvcConfigurer
that automates MockMvc setup. - apply(MockMvcConfigurer) - Method in class org.springframework.test.web.servlet.setup.AbstractMockMvcBuilder
- apply(MockMvcConfigurer) - Method in interface org.springframework.test.web.servlet.setup.ConfigurableMockMvcBuilder
-
Add a
MockMvcConfigurer
that automates MockMvc setup and configures it for some specific purpose (e.g. - applyCookies() - Method in class org.springframework.mock.http.client.reactive.MockClientHttpRequest
- applyCookies() - Method in class org.springframework.mock.http.server.reactive.MockServerHttpResponse
- applyHeaders() - Method in class org.springframework.mock.http.client.reactive.MockClientHttpRequest
- applyHeaders() - Method in class org.springframework.mock.http.server.reactive.MockServerHttpResponse
- applyStatusCode() - Method in class org.springframework.mock.http.server.reactive.MockServerHttpResponse
- argumentResolvers(Consumer<ArgumentResolverConfigurer>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.ControllerSpec
-
Configure resolvers for custom controller method arguments.
- assertAndReturnModelAttributeOfType(ModelAndView, String, Class<T>) - Static method in class org.springframework.test.web.ModelAndViewAssert
-
Checks whether the model value under the given
modelName
exists and checks its type, based on theexpectedType
. - assertBoolean(byte[], String, boolean) - Method in class org.springframework.test.util.XpathExpectationsHelper
-
Apply the XPath expression and assert the resulting content as a Boolean.
- assertCompareListModelAttribute(ModelAndView, String, List) - Static method in class org.springframework.test.web.ModelAndViewAssert
-
Compare each individual entry in a list, without first sorting the lists.
- assertEmpty() - Method in class org.springframework.test.util.ExceptionCollector
-
Assert that this
ExceptionCollector
does not contain any exceptions. - assertEquals(String, Object, Object) - Static method in class org.springframework.test.util.AssertionErrors
-
Assert two objects are equal and raise an
AssertionError
otherwise. - assertFalse(String, boolean) - Static method in class org.springframework.test.util.AssertionErrors
-
Assert the given condition is
false
and raise anAssertionError
otherwise. - AssertionErrors - Class in org.springframework.test.util
-
Test assertions that are independent of any third-party assertion library.
- AssertionErrors() - Constructor for class org.springframework.test.util.AssertionErrors
- assertJsonEqual(String, String) - Method in class org.springframework.test.util.JsonExpectationsHelper
-
Parse the expected and actual strings as JSON and assert the two are "similar" - i.e.
- assertJsonEqual(String, String, boolean) - Method in class org.springframework.test.util.JsonExpectationsHelper
-
Parse the expected and actual strings as JSON and assert the two are "similar" - i.e.
- assertJsonNotEqual(String, String) - Method in class org.springframework.test.util.JsonExpectationsHelper
-
Parse the expected and actual strings as JSON and assert the two are "not similar" - i.e.
- assertJsonNotEqual(String, String, boolean) - Method in class org.springframework.test.util.JsonExpectationsHelper
-
Parse the expected and actual strings as JSON and assert the two are "not similar" - i.e.
- assertModelAttributeAvailable(ModelAndView, String) - Static method in class org.springframework.test.web.ModelAndViewAssert
-
Assert whether a model attribute is available.
- assertModelAttributeValue(ModelAndView, String, Object) - Static method in class org.springframework.test.web.ModelAndViewAssert
-
Compare a given
expectedValue
to the value from the model bound under the givenmodelName
. - assertModelAttributeValues(ModelAndView, Map<String, Object>) - Static method in class org.springframework.test.web.ModelAndViewAssert
-
Inspect the
expectedModel
to see if all elements in the model appear and are equal. - assertNode(byte[], String, Matcher<? super Node>) - Method in class org.springframework.test.util.XpathExpectationsHelper
-
Parse the content, evaluate the XPath expression as a
Node
, and assert it with the givenMatcher<Node>
. - assertNode(String, Matcher<? super Node>) - Method in class org.springframework.test.util.XmlExpectationsHelper
- assertNodeCount(byte[], String, int) - Method in class org.springframework.test.util.XpathExpectationsHelper
-
Apply the XPath expression and assert the resulting content as an integer.
- assertNodeCount(byte[], String, Matcher<? super Integer>) - Method in class org.springframework.test.util.XpathExpectationsHelper
-
Apply the XPath expression and assert the resulting content with the given Hamcrest matcher.
- assertNodeList(byte[], String, Matcher<? super NodeList>) - Method in class org.springframework.test.util.XpathExpectationsHelper
-
Parse the content, evaluate the XPath expression as a
NodeList
, and assert it with the givenMatcher<NodeList>
. - assertNotEquals(String, Object, Object) - Static method in class org.springframework.test.util.AssertionErrors
-
Assert two objects are not equal and raise an
AssertionError
otherwise. - assertNotNull(String, Object) - Static method in class org.springframework.test.util.AssertionErrors
-
Assert that the given object is not
null
and raise anAssertionError
otherwise. - assertNull(String, Object) - Static method in class org.springframework.test.util.AssertionErrors
-
Assert that the given object is
null
and raise anAssertionError
otherwise. - assertNumber(byte[], String, Double) - Method in class org.springframework.test.util.XpathExpectationsHelper
-
Apply the XPath expression and assert the resulting content as a Double.
- assertNumber(byte[], String, Matcher<? super Double>) - Method in class org.springframework.test.util.XpathExpectationsHelper
-
Apply the XPath expression and assert the resulting content with the given Hamcrest matcher.
- assertSortAndCompareListModelAttribute(ModelAndView, String, List, Comparator) - Static method in class org.springframework.test.web.ModelAndViewAssert
-
Compare each individual entry in a list after having sorted both lists (optionally using a comparator).
- assertSource(String, Matcher<? super Source>) - Method in class org.springframework.test.util.XmlExpectationsHelper
- assertString(byte[], String, String) - Method in class org.springframework.test.util.XpathExpectationsHelper
-
Apply the XPath expression and assert the resulting content as a String.
- assertString(byte[], String, Matcher<? super String>) - Method in class org.springframework.test.util.XpathExpectationsHelper
-
Apply the XPath expression and assert the resulting content with the given Hamcrest matcher.
- assertTrue(String, boolean) - Static method in class org.springframework.test.util.AssertionErrors
-
Assert the given condition is
true
and raise anAssertionError
otherwise. - assertValue(String, Object) - Method in class org.springframework.test.util.JsonPathExpectationsHelper
-
Evaluate the JSON path expression against the supplied
content
and assert that the result is equal to the expected value. - assertValue(String, Matcher<? super T>) - Method in class org.springframework.test.util.JsonPathExpectationsHelper
-
Evaluate the JSON path expression against the supplied
content
and assert the resulting value with the givenMatcher
. - assertValue(String, Matcher<? super T>, Class<T>) - Method in class org.springframework.test.util.JsonPathExpectationsHelper
-
An overloaded variant of
JsonPathExpectationsHelper.assertValue(String, Matcher)
that also accepts a target type for the resulting value. - assertValueIsArray(String) - Method in class org.springframework.test.util.JsonPathExpectationsHelper
-
Evaluate the JSON path expression against the supplied
content
and assert that the resulting value is an array. - assertValueIsBoolean(String) - Method in class org.springframework.test.util.JsonPathExpectationsHelper
-
Evaluate the JSON path expression against the supplied
content
and assert that the resulting value is aBoolean
. - assertValueIsEmpty(String) - Method in class org.springframework.test.util.JsonPathExpectationsHelper
-
Evaluate the JSON path expression against the supplied
content
and assert that an empty value exists at the given path. - assertValueIsMap(String) - Method in class org.springframework.test.util.JsonPathExpectationsHelper
-
Evaluate the JSON path expression against the supplied
content
and assert that the resulting value is aMap
. - assertValueIsNotEmpty(String) - Method in class org.springframework.test.util.JsonPathExpectationsHelper
-
Evaluate the JSON path expression against the supplied
content
and assert that a non-empty value exists at the given path. - assertValueIsNumber(String) - Method in class org.springframework.test.util.JsonPathExpectationsHelper
-
Evaluate the JSON path expression against the supplied
content
and assert that the resulting value is aNumber
. - assertValueIsString(String) - Method in class org.springframework.test.util.JsonPathExpectationsHelper
-
Evaluate the JSON path expression against the supplied
content
and assert that the resulting value is aString
. - assertViewName(ModelAndView, String) - Static method in class org.springframework.test.web.ModelAndViewAssert
-
Check to see if the view name in the ModelAndView matches the given
expectedName
. - assertWithDiagnostics(Runnable) - Method in class org.springframework.test.web.reactive.server.ExchangeResult
-
Execute the given Runnable, catch any
AssertionError
, log details about the request and response at ERROR level under the class log category, and after that re-throw the error. - assertXmlEqual(String, String) - Method in class org.springframework.test.util.XmlExpectationsHelper
-
Parse the expected and actual content strings as XML and assert that the two are "similar" -- i.e.
- asyncDispatch(MvcResult) - Static method in class org.springframework.test.web.servlet.request.MockMvcRequestBuilders
-
Create a
RequestBuilder
for an async dispatch from theMvcResult
of the request that started async processing. - asyncNotStarted() - Method in class org.springframework.test.web.servlet.result.RequestResultMatchers
-
Assert that asynchronous processing was not started.
- asyncRequestTimeout(long) - Method in interface org.springframework.test.web.servlet.client.MockMvcWebTestClient.ControllerSpec
-
Specify the timeout value for async execution.
- asyncResult(Object) - Method in class org.springframework.test.web.servlet.result.RequestResultMatchers
-
Assert the result from asynchronous processing.
- asyncResult(Matcher<? super T>) - Method in class org.springframework.test.web.servlet.result.RequestResultMatchers
-
Assert the result from asynchronous processing with the given matcher.
- asyncStarted() - Method in class org.springframework.test.web.servlet.result.RequestResultMatchers
-
Assert whether asynchronous processing started, usually as a result of a controller method returning
Callable
orDeferredResult
. - attribute(String, Object) - Method in interface org.springframework.mock.web.reactive.function.server.MockServerRequest.Builder
- attribute(String, Object) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.RequestHeadersSpec
-
Set the attribute with the given name to the given value.
- attribute(String, Object) - Method in class org.springframework.test.web.servlet.result.FlashAttributeResultMatchers
-
Assert a flash attribute's value.
- attribute(String, Object) - Method in class org.springframework.test.web.servlet.result.ModelResultMatchers
-
Assert a model attribute value.
- attribute(String, Object) - Method in class org.springframework.test.web.servlet.result.RequestResultMatchers
-
Assert a request attribute value.
- attribute(String, String, String) - Method in class org.springframework.test.web.servlet.result.CookieResultMatchers
-
Assert a cookie's specified attribute.
- attribute(String, String, Matcher<? super String>) - Method in class org.springframework.test.web.servlet.result.CookieResultMatchers
-
Assert a cookie's specified attribute with a Hamcrest
Matcher
. - attribute(String, Matcher<? super T>) - Method in class org.springframework.test.web.servlet.result.FlashAttributeResultMatchers
-
Assert a flash attribute's value with the given Hamcrest
Matcher
. - attribute(String, Matcher<? super T>) - Method in class org.springframework.test.web.servlet.result.ModelResultMatchers
-
Assert a model attribute value with the given Hamcrest
Matcher
. - attribute(String, Matcher<? super T>) - Method in class org.springframework.test.web.servlet.result.RequestResultMatchers
-
Assert a request attribute value with the given Hamcrest
Matcher
. - attributeCount(int) - Method in class org.springframework.test.web.servlet.result.FlashAttributeResultMatchers
-
Assert the number of flash attributes.
- attributeDoesNotExist(String...) - Method in class org.springframework.test.web.servlet.result.ModelResultMatchers
-
Assert the given model attributes do not exist.
- attributeErrorCount(String, int) - Method in class org.springframework.test.web.servlet.result.ModelResultMatchers
-
Assert the given model attribute(s) have errors.
- attributeExists(String...) - Method in class org.springframework.test.web.servlet.result.FlashAttributeResultMatchers
-
Assert the existence of the given flash attributes.
- attributeExists(String...) - Method in class org.springframework.test.web.servlet.result.ModelResultMatchers
-
Assert the given model attributes exist.
- attributeHasErrors(String...) - Method in class org.springframework.test.web.servlet.result.ModelResultMatchers
-
Assert the given model attribute(s) have errors.
- attributeHasFieldErrorCode(String, String, String) - Method in class org.springframework.test.web.servlet.result.ModelResultMatchers
-
Assert a field error code for a model attribute using exact String match.
- attributeHasFieldErrorCode(String, String, Matcher<? super String>) - Method in class org.springframework.test.web.servlet.result.ModelResultMatchers
-
Assert a field error code for a model attribute using a
Matcher
. - attributeHasFieldErrors(String, String...) - Method in class org.springframework.test.web.servlet.result.ModelResultMatchers
-
Assert the given model attribute field(s) have errors.
- attributeHasNoErrors(String...) - Method in class org.springframework.test.web.servlet.result.ModelResultMatchers
-
Assert the given model attribute(s) do not have errors.
- attributeNames() - Method in class org.springframework.test.context.support.DefaultTestContext
- attributes() - Method in class org.springframework.mock.web.reactive.function.server.MockServerRequest
- attributes(Consumer<Map<String, Object>>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.RequestHeadersSpec
-
Manipulate the request attributes with the given consumer.
- attributes(Map<String, Object>) - Method in interface org.springframework.mock.web.reactive.function.server.MockServerRequest.Builder
- attributeSource - Variable in class org.springframework.test.context.transaction.TransactionalTestExecutionListener
- authenticate(HttpServletResponse) - Method in class org.springframework.mock.web.MockHttpServletRequest
- autowireMode() - Element in annotation interface org.springframework.test.context.TestConstructor
-
Flag for setting the test constructor autowire mode for the current test class.
- available() - Method in class org.springframework.mock.web.DelegatingServletInputStream
B
- baseUrl(String) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.Builder
-
Configure a base URI as described in
WebClient.create(String)
. - BEFORE_CLASS - Enum constant in enum class org.springframework.test.annotation.DirtiesContext.ClassMode
-
The associated
ApplicationContext
will be marked as dirty before the test class. - BEFORE_EACH_TEST_METHOD - Enum constant in enum class org.springframework.test.annotation.DirtiesContext.ClassMode
-
The associated
ApplicationContext
will be marked as dirty before each test method in the class. - BEFORE_METHOD - Enum constant in enum class org.springframework.test.annotation.DirtiesContext.MethodMode
-
The associated
ApplicationContext
will be marked as dirty before the corresponding test method. - BEFORE_TEST_CLASS - Enum constant in enum class org.springframework.test.context.jdbc.Sql.ExecutionPhase
-
The configured SQL scripts and statements will be executed once per test class before any test method is run.
- BEFORE_TEST_METHOD - Enum constant in enum class org.springframework.test.context.jdbc.Sql.ExecutionPhase
-
The configured SQL scripts and statements will be executed before the corresponding test method.
- beforeAll(ExtensionContext) - Method in class org.springframework.test.context.junit.jupiter.SpringExtension
-
Delegates to
TestContextManager.beforeTestClass()
. - beforeEach(ExtensionContext) - Method in class org.springframework.test.context.junit.jupiter.SpringExtension
- beforeMockMvcCreated(ConfigurableMockMvcBuilder<?>, WebApplicationContext) - Method in interface org.springframework.test.web.servlet.setup.MockMvcConfigurer
-
Invoked when the MockMvc instance is about to be created with the MockMvc builder and the Spring WebApplicationContext that will be passed to the
DispatcherServlet
. - beforeMockMvcCreated(ConfigurableMockMvcBuilder<?>, WebApplicationContext) - Method in class org.springframework.test.web.servlet.setup.MockMvcConfigurerAdapter
- beforeMockMvcCreated(ConfigurableMockMvcBuilder<?>, WebApplicationContext) - Method in class org.springframework.test.web.servlet.setup.SharedHttpSessionConfigurer
- beforeOrAfterTestClass(TestContext, DirtiesContext.ClassMode) - Method in class org.springframework.test.context.support.AbstractDirtiesContextTestExecutionListener
-
Perform the actual work for
AbstractTestExecutionListener.beforeTestClass(org.springframework.test.context.TestContext)
andAbstractTestExecutionListener.afterTestClass(org.springframework.test.context.TestContext)
by dirtying the context if appropriate (i.e., according to the required mode). - beforeOrAfterTestMethod(TestContext, DirtiesContext.MethodMode, DirtiesContext.ClassMode) - Method in class org.springframework.test.context.support.AbstractDirtiesContextTestExecutionListener
-
Perform the actual work for
AbstractTestExecutionListener.beforeTestMethod(org.springframework.test.context.TestContext)
andAbstractTestExecutionListener.afterTestMethod(org.springframework.test.context.TestContext)
by dirtying the context if appropriate (i.e., according to the required modes). - beforeServerCreated(WebHttpHandlerBuilder) - Method in interface org.springframework.test.web.reactive.server.MockServerConfigurer
-
Invoked just before the mock server is built.
- beforeTestClass() - Method in class org.springframework.test.context.TestContextManager
-
Hook for pre-processing a test class before execution of any tests within the class.
- beforeTestClass(TestContext) - Method in class org.springframework.test.context.event.EventPublishingTestExecutionListener
- beforeTestClass(TestContext) - Method in class org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener
-
Execute SQL scripts configured via
@Sql
for the suppliedTestContext
once per test class before any test method is run. - beforeTestClass(TestContext) - Method in class org.springframework.test.context.support.AbstractTestExecutionListener
-
The default implementation is empty.
- beforeTestClass(TestContext) - Method in class org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener
-
If the test class of the supplied test context is annotated with
@DirtiesContext
and the class mode is set toBEFORE_CLASS
, the application context of the test context will be marked as dirty, and theREINJECT_DEPENDENCIES_ATTRIBUTE
in the test context will be set totrue
. - beforeTestClass(TestContext) - Method in interface org.springframework.test.context.TestExecutionListener
-
Pre-processes a test class before execution of all tests within the class.
- BeforeTestClass - Annotation Interface in org.springframework.test.context.event.annotation
-
@EventListener
annotation used to consume aBeforeTestClassEvent
published by theEventPublishingTestExecutionListener
. - BeforeTestClassEvent - Class in org.springframework.test.context.event
-
TestContextEvent
published by theEventPublishingTestExecutionListener
whenTestExecutionListener.beforeTestClass(TestContext)
is invoked. - BeforeTestClassEvent(TestContext) - Constructor for class org.springframework.test.context.event.BeforeTestClassEvent
- beforeTestExecution(Object, Method) - Method in class org.springframework.test.context.TestContextManager
-
Hook for pre-processing a test immediately before execution of the test method in the supplied test context — for example, for timing or logging purposes.
- beforeTestExecution(ExtensionContext) - Method in class org.springframework.test.context.junit.jupiter.SpringExtension
- beforeTestExecution(TestContext) - Method in class org.springframework.test.context.event.EventPublishingTestExecutionListener
- beforeTestExecution(TestContext) - Method in class org.springframework.test.context.support.AbstractTestExecutionListener
-
The default implementation is empty.
- beforeTestExecution(TestContext) - Method in interface org.springframework.test.context.TestExecutionListener
-
Pre-processes a test immediately before execution of the test method in the supplied test context — for example, for timing or logging purposes.
- BeforeTestExecution - Annotation Interface in org.springframework.test.context.event.annotation
-
@EventListener
annotation used to consume aBeforeTestExecution
published by theEventPublishingTestExecutionListener
. - BeforeTestExecutionEvent - Class in org.springframework.test.context.event
-
TestContextEvent
published by theEventPublishingTestExecutionListener
whenTestExecutionListener.beforeTestExecution(TestContext)
is invoked. - BeforeTestExecutionEvent(TestContext) - Constructor for class org.springframework.test.context.event.BeforeTestExecutionEvent
- beforeTestMethod(Object, Method) - Method in class org.springframework.test.context.TestContextManager
-
Hook for pre-processing a test before execution of before lifecycle callbacks of the underlying test framework — for example, setting up test fixtures, starting a transaction, etc.
- beforeTestMethod(TestContext) - Method in class org.springframework.test.context.event.ApplicationEventsTestExecutionListener
- beforeTestMethod(TestContext) - Method in class org.springframework.test.context.event.EventPublishingTestExecutionListener
- beforeTestMethod(TestContext) - Method in class org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener
-
Execute SQL scripts configured via
@Sql
for the suppliedTestContext
before the current test method. - beforeTestMethod(TestContext) - Method in class org.springframework.test.context.support.AbstractTestExecutionListener
-
The default implementation is empty.
- beforeTestMethod(TestContext) - Method in class org.springframework.test.context.support.DependencyInjectionTestExecutionListener
-
If the
DependencyInjectionTestExecutionListener.REINJECT_DEPENDENCIES_ATTRIBUTE
in the suppliedtest context
has a value ofBoolean.TRUE
, this method will have the same effect asprepareTestInstance()
; otherwise, this method will have no effect. - beforeTestMethod(TestContext) - Method in class org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener
-
If the current test method of the supplied test context is annotated with
@DirtiesContext
and the method mode is set toBEFORE_METHOD
, or if the test class is annotated with@DirtiesContext
and the class mode is set toBEFORE_EACH_TEST_METHOD
, the application context of the test context will be marked as dirty and theREINJECT_DEPENDENCIES_ATTRIBUTE
in the test context will be set totrue
. - beforeTestMethod(TestContext) - Method in interface org.springframework.test.context.TestExecutionListener
-
Pre-processes a test before execution of before lifecycle callbacks of the underlying test framework — for example, by setting up test fixtures.
- beforeTestMethod(TestContext) - Method in class org.springframework.test.context.transaction.TransactionalTestExecutionListener
-
If the test method of the supplied test context is configured to run within a transaction, this method will run
@BeforeTransaction
methods and start a new transaction. - beforeTestMethod(TestContext) - Method in class org.springframework.test.context.web.ServletTestExecutionListener
-
Sets up thread-local state before each test method via Spring Web's
RequestContextHolder
, but only if the test class is annotated with@WebAppConfiguration
. - BeforeTestMethod - Annotation Interface in org.springframework.test.context.event.annotation
-
@EventListener
annotation used to consume aBeforeTestMethodEvent
published by theEventPublishingTestExecutionListener
. - BeforeTestMethodEvent - Class in org.springframework.test.context.event
-
TestContextEvent
published by theEventPublishingTestExecutionListener
whenTestExecutionListener.beforeTestMethod(TestContext)
is invoked. - BeforeTestMethodEvent(TestContext) - Constructor for class org.springframework.test.context.event.BeforeTestMethodEvent
- BeforeTransaction - Annotation Interface in org.springframework.test.context.transaction
-
Test annotation which indicates that the annotated
void
method should be executed before a transaction is started for a test method configured to run within a transaction via Spring's@Transactional
annotation. - between(int, int) - Static method in class org.springframework.test.web.client.ExpectedCount
-
Between
min
andmax
number of times. - bind(Class<T>) - Method in class org.springframework.mock.web.reactive.function.server.MockServerRequest
- bind(Class<T>, Consumer<WebDataBinder>) - Method in class org.springframework.mock.web.reactive.function.server.MockServerRequest
- bindTo(MockMvc) - Static method in interface org.springframework.test.web.servlet.client.MockMvcWebTestClient
-
Begin creating a
WebTestClient
by providing an already initializedMockMvc
instance to use as the server. - bindTo(RestClient.Builder) - Static method in class org.springframework.test.web.client.MockRestServiceServer
-
Return a builder for a
MockRestServiceServer
that should be used to reply to theRestClient
for the givenRestClient.Builder
. - bindTo(RestTemplate) - Static method in class org.springframework.test.web.client.MockRestServiceServer
-
Return a builder for a
MockRestServiceServer
that should be used to reply to the givenRestTemplate
. - bindTo(RestGatewaySupport) - Static method in class org.springframework.test.web.client.MockRestServiceServer
-
Return a builder for a
MockRestServiceServer
that should be used to reply to theRestTemplate
for the givenRestGatewaySupport
. - bindToApplicationContext(ApplicationContext) - Static method in interface org.springframework.test.web.reactive.server.WebTestClient
-
Use this option to set up a server from the Spring configuration of your application, or some subset of it.
- bindToApplicationContext(WebApplicationContext) - Static method in interface org.springframework.test.web.servlet.client.MockMvcWebTestClient
-
Begin creating a
WebTestClient
by providing aWebApplicationContext
with Spring MVC infrastructure and controllers. - bindToController(Object...) - Static method in interface org.springframework.test.web.reactive.server.WebTestClient
-
Use this server setup to test one
@Controller
at a time. - bindToController(Object...) - Static method in interface org.springframework.test.web.servlet.client.MockMvcWebTestClient
-
Begin creating a
WebTestClient
by providing the@Controller
instance(s) to handle requests with. - bindToRouterFunction(RouterFunction<?>) - Static method in interface org.springframework.test.web.reactive.server.WebTestClient
-
Use this option to set up a server from a
RouterFunction
. - bindToServer() - Static method in interface org.springframework.test.web.reactive.server.WebTestClient
-
This server setup option allows you to connect to a live server through a Reactor Netty client connector.
- bindToServer(ClientHttpConnector) - Static method in interface org.springframework.test.web.reactive.server.WebTestClient
-
A variant of
WebTestClient.bindToServer()
with a pre-configured connector. - bindToWebHandler(WebHandler) - Static method in interface org.springframework.test.web.reactive.server.WebTestClient
-
Integration testing with a "mock" server targeting the given WebHandler.
- blockCommentEndDelimiter() - Element in annotation interface org.springframework.test.context.jdbc.SqlConfig
-
The end delimiter that identifies block comments within the SQL scripts.
- blockCommentStartDelimiter() - Element in annotation interface org.springframework.test.context.jdbc.SqlConfig
-
The start delimiter that identifies block comments within the SQL scripts.
- blockingExecution(Consumer<BlockingExecutionConfigurer>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.ControllerSpec
-
Configure blocking execution options.
- body(byte[]) - Method in class org.springframework.test.web.client.response.DefaultResponseCreator
-
Set the body as a byte array.
- body(Object) - Method in interface org.springframework.mock.web.reactive.function.server.MockServerRequest.Builder
- body(Object, Class<?>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.RequestBodySpec
-
Set the body from the given producer.
- body(Object, ParameterizedTypeReference<?>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.RequestBodySpec
-
Set the body from the given producer.
- body(String) - Method in interface org.springframework.mock.http.server.reactive.MockServerHttpRequest.BodyBuilder
-
Set the body of the request and build it.
- body(String) - Method in class org.springframework.test.web.client.response.DefaultResponseCreator
-
Set the body as a UTF-8 String.
- body(String, Charset) - Method in class org.springframework.test.web.client.response.DefaultResponseCreator
-
Set the body from a string using the given character set.
- body(Publisher<? extends DataBuffer>) - Method in interface org.springframework.mock.http.server.reactive.MockServerHttpRequest.BodyBuilder
-
Set the body of the request and build it.
- body(Resource) - Method in class org.springframework.test.web.client.response.DefaultResponseCreator
-
Set the body from a
Resource
. - body(BodyExtractor<S, ? super ServerHttpRequest>) - Method in class org.springframework.mock.web.reactive.function.server.MockServerRequest
- body(BodyExtractor<S, ? super ServerHttpRequest>, Map<String, Object>) - Method in class org.springframework.mock.web.reactive.function.server.MockServerRequest
- body(BodyInserter<?, ? super ClientHttpRequest>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.RequestBodySpec
-
Set the body of the request to the given
BodyInserter
. - body(S, Class<T>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.RequestBodySpec
-
Set the body from the given
Publisher
. - body(S, ParameterizedTypeReference<T>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.RequestBodySpec
-
Variant of
WebTestClient.RequestBodySpec.body(Publisher, Class)
that allows providing element type information with generics. - bodyToFlux(Class<? extends S>) - Method in class org.springframework.mock.web.reactive.function.server.MockServerRequest
- bodyToFlux(ParameterizedTypeReference<S>) - Method in class org.springframework.mock.web.reactive.function.server.MockServerRequest
- bodyToMono(Class<? extends S>) - Method in class org.springframework.mock.web.reactive.function.server.MockServerRequest
- bodyToMono(ParameterizedTypeReference<S>) - Method in class org.springframework.mock.web.reactive.function.server.MockServerRequest
- bodyValue(Object) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.RequestBodySpec
-
Set the body to the given
Object
value. - booleanValue(Boolean) - Method in class org.springframework.test.web.client.match.XpathRequestMatchers
-
Apply the XPath and assert the boolean value found.
- booleanValue(Boolean) - Method in class org.springframework.test.web.servlet.result.XpathResultMatchers
-
Evaluate the XPath and assert the
Boolean
value found. - BootstrapContext - Interface in org.springframework.test.context
-
BootstrapContext
encapsulates the context in which the Spring TestContext Framework is bootstrapped. - BootstrapUtils - Class in org.springframework.test.context
-
BootstrapUtils
is a collection of utility methods to assist with bootstrapping the Spring TestContext Framework. - BootstrapUtils() - Constructor for class org.springframework.test.context.BootstrapUtils
- BootstrapWith - Annotation Interface in org.springframework.test.context
-
@BootstrapWith
defines class-level metadata that is used to determine how to bootstrap the Spring TestContext Framework. - bufferContent() - Method in interface org.springframework.test.web.client.MockRestServiceServer.MockRestServiceServerBuilder
-
Use the
BufferingClientHttpRequestFactory
wrapper to buffer the input and output streams, and for example, allow multiple reads of the response body. - bufferFactory() - Method in class org.springframework.mock.http.client.reactive.MockClientHttpRequest
- build() - Method in interface org.springframework.mock.http.server.reactive.MockServerHttpRequest.BaseBuilder
-
Builds the request with no body.
- build() - Method in interface org.springframework.mock.web.reactive.function.server.MockServerRequest.Builder
- build() - Method in class org.springframework.mock.web.server.MockServerWebExchange.Builder
-
Build the
MockServerWebExchange
instance. - build() - Method in interface org.springframework.test.web.client.MockRestServiceServer.MockRestServiceServerBuilder
-
Build the
MockRestServiceServer
and set up the underlyingRestTemplate
with aClientHttpRequestFactory
that creates mock requests. - build() - Method in interface org.springframework.test.web.reactive.server.WebTestClient.Builder
-
Build the
WebTestClient
instance. - build() - Method in interface org.springframework.test.web.reactive.server.WebTestClient.MockServerSpec
-
Shortcut to build the test client.
- build() - Method in interface org.springframework.test.web.servlet.client.MockMvcWebTestClient.MockMvcServerSpec
-
Shortcut to build the test client.
- build() - Method in class org.springframework.test.web.servlet.htmlunit.MockMvcWebClientBuilder
-
Build the
WebClient
configured via this builder. - build() - Method in class org.springframework.test.web.servlet.htmlunit.webdriver.MockMvcHtmlUnitDriverBuilder
-
Build the
HtmlUnitDriver
configured via this builder. - build() - Method in interface org.springframework.test.web.servlet.MockMvcBuilder
-
Build a
MockMvc
instance. - build() - Method in class org.springframework.test.web.servlet.setup.AbstractMockMvcBuilder
-
Build a
MockMvc
instance. - build(RequestExpectationManager) - Method in interface org.springframework.test.web.client.MockRestServiceServer.MockRestServiceServerBuilder
-
An overloaded build alternative that accepts a custom
RequestExpectationManager
. - builder() - Static method in class org.springframework.mock.web.reactive.function.server.MockServerRequest
- builder(MockServerHttpRequest) - Static method in class org.springframework.mock.web.server.MockServerWebExchange
-
Create a
MockServerWebExchange.Builder
starting with the given mock request. - builder(MockServerHttpRequest.BaseBuilder<?>) - Static method in class org.springframework.mock.web.server.MockServerWebExchange
-
Variant of
MockServerWebExchange.builder(MockServerHttpRequest)
with a mock request builder. - Builder(MockServerHttpRequest) - Constructor for class org.springframework.mock.web.server.MockServerWebExchange.Builder
- buildMergedContextConfiguration() - Method in class org.springframework.test.context.support.AbstractTestContextBootstrapper
- buildMergedContextConfiguration() - Method in interface org.springframework.test.context.TestContextBootstrapper
-
Build the merged context configuration for the test class in the
BootstrapContext
associated with this bootstrapper. - buildRequest(ServletContext) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Build a
MockHttpServletRequest
. - buildRequest(ServletContext) - Method in interface org.springframework.test.web.servlet.RequestBuilder
-
Build the request.
- buildTestContext() - Method in class org.springframework.test.context.support.AbstractTestContextBootstrapper
-
Build a new
DefaultTestContext
using the test class in theBootstrapContext
associated with this bootstrapper and by delegating toAbstractTestContextBootstrapper.buildMergedContextConfiguration()
andAbstractTestContextBootstrapper.getCacheAwareContextLoaderDelegate()
. - buildTestContext() - Method in interface org.springframework.test.context.TestContextBootstrapper
-
Build the
TestContext
for theBootstrapContext
associated with this bootstrapper. - bytes(byte[]) - Method in class org.springframework.test.web.client.match.ContentRequestMatchers
-
Compare the body of the request to the given byte array.
- bytes(byte[]) - Method in class org.springframework.test.web.servlet.result.ContentResultMatchers
-
Assert the response body content as a byte array.
C
- CacheAwareContextLoaderDelegate - Interface in org.springframework.test.context
-
A
CacheAwareContextLoaderDelegate
is responsible for loading and closing application contexts, interacting transparently with aContextCache
behind the scenes. - cacheControl(CacheControl) - Method in class org.springframework.test.web.reactive.server.HeaderAssertions
-
Expect a "Cache-Control" header with the given value.
- changeSessionId() - Method in class org.springframework.mock.web.MockHttpServletRequest
-
The implementation of this (Servlet 3.1+) method calls
MockHttpSession.changeSessionId()
if the session is a mock session. - changeSessionId() - Method in class org.springframework.mock.web.MockHttpSession
-
As of Servlet 3.1, the id of a session can be changed.
- changeSessionId() - Method in class org.springframework.mock.web.server.MockWebSession
- characterEncoding(String) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Set the character encoding of the request.
- characterEncoding(Charset) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Set the character encoding of the request.
- checkActive() - Method in class org.springframework.mock.web.MockHttpServletRequest
-
Check whether this request is still active (that is, not completed yet), throwing an IllegalStateException if not active anymore.
- classes() - Element in annotation interface org.springframework.test.context.ContextConfiguration
-
The component classes to use for loading an
ApplicationContext
. - classes() - Element in annotation interface org.springframework.test.context.junit.jupiter.SpringJUnitConfig
-
Alias for
ContextConfiguration.classes()
. - classes() - Element in annotation interface org.springframework.test.context.junit.jupiter.web.SpringJUnitWebConfig
-
Alias for
ContextConfiguration.classes()
. - classMode() - Element in annotation interface org.springframework.test.annotation.DirtiesContext
-
The mode to use when a test class is annotated with
@DirtiesContext
. - clear() - Method in class org.springframework.mock.web.MockBodyContent
- clear() - Method in class org.springframework.mock.web.MockJspWriter
- clear() - Method in interface org.springframework.test.context.cache.ContextCache
-
Clear all contexts from the cache, clearing context hierarchy information as well.
- clear() - Method in class org.springframework.test.context.cache.DefaultContextCache
- clear() - Method in interface org.springframework.test.context.event.ApplicationEvents
-
Clear all application events recorded by this
ApplicationEvents
instance. - clearAttributes() - Method in class org.springframework.mock.web.MockHttpServletRequest
-
Clear all of this request's attributes.
- clearAttributes() - Method in class org.springframework.mock.web.MockHttpSession
-
Clear all of this session's attributes.
- clearBuffer() - Method in class org.springframework.mock.web.MockBodyContent
- clearBuffer() - Method in class org.springframework.mock.web.MockJspWriter
- clearStatistics() - Method in interface org.springframework.test.context.cache.ContextCache
-
Clear hit count and miss count statistics for the cache (i.e., reset counters to zero).
- clearStatistics() - Method in class org.springframework.test.context.cache.DefaultContextCache
- clientConnector(ClientHttpConnector) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.Builder
-
Set the
ClientHttpConnector
to use. - close() - Method in class org.springframework.mock.http.client.MockClientHttpResponse
- close() - Method in class org.springframework.mock.web.DelegatingServletInputStream
- close() - Method in class org.springframework.mock.web.DelegatingServletOutputStream
- close() - Method in class org.springframework.mock.web.MockBodyContent
- close() - Method in class org.springframework.mock.web.MockHttpServletRequest
-
Mark this request as completed, keeping its state.
- close() - Method in class org.springframework.mock.web.MockJspWriter
- close() - Method in class org.springframework.test.web.servlet.htmlunit.DelegatingWebConnection
- close() - Method in class org.springframework.test.web.servlet.htmlunit.MockMvcWebConnection
- closeContext(MergedContextConfiguration, DirtiesContext.HierarchyMode) - Method in class org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate
- closeContext(MergedContextConfiguration, DirtiesContext.HierarchyMode) - Method in interface org.springframework.test.context.CacheAwareContextLoaderDelegate
-
Remove the application context for the supplied
MergedContextConfiguration
from theContextCache
and close it if it is an instance ofConfigurableApplicationContext
. - codecs(Consumer<ClientCodecConfigurer>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.Builder
- comment(String, String) - Method in class org.springframework.test.web.servlet.result.CookieResultMatchers
-
Assert a cookie's comment.
- comment(String, Matcher<? super String>) - Method in class org.springframework.test.web.servlet.result.CookieResultMatchers
-
Assert a cookie's comment with a Hamcrest
Matcher
. - commentPrefix() - Element in annotation interface org.springframework.test.context.jdbc.SqlConfig
-
The prefix that identifies single-line comments within the SQL scripts.
- commentPrefixes() - Element in annotation interface org.springframework.test.context.jdbc.SqlConfig
-
The prefixes that identify single-line comments within the SQL scripts.
- Commit - Annotation Interface in org.springframework.test.annotation
-
@Commit
is a test annotation that is used to indicate that a test-managed transaction should be committed after the test method has completed. - complete() - Method in class org.springframework.mock.web.MockAsyncContext
- computeAttribute(String, Function<String, T>) - Method in class org.springframework.test.context.support.DefaultTestContext
- config() - Element in annotation interface org.springframework.test.context.jdbc.Sql
-
Local configuration for the SQL scripts and statements declared within this
@Sql
annotation. - ConfigurableMockMvcBuilder<B extends ConfigurableMockMvcBuilder<B>> - Interface in org.springframework.test.web.servlet.setup
-
Defines common methods for building a
MockMvc
. - ConfigurableSmartRequestBuilder<B extends ConfigurableSmartRequestBuilder<B>> - Interface in org.springframework.test.web.servlet.request
-
An extension of
SmartRequestBuilder
that can be configured withRequestPostProcessors
. - configureClient() - Method in interface org.springframework.test.web.reactive.server.WebTestClient.MockServerSpec
-
Proceed to configure and build the test client.
- configureClient() - Method in interface org.springframework.test.web.servlet.client.MockMvcWebTestClient.MockMvcServerSpec
-
Proceed to configure and build the test client.
- configureWebResources(GenericWebApplicationContext, WebMergedContextConfiguration) - Method in class org.springframework.test.context.web.AbstractGenericWebContextLoader
-
Configures web resources for the supplied web application context (WAC).
- connect(HttpMethod, URI, Function<? super ClientHttpRequest, Mono<Void>>) - Method in class org.springframework.test.web.reactive.server.HttpHandlerConnector
- connect(HttpMethod, URI, Function<? super ClientHttpRequest, Mono<Void>>) - Method in class org.springframework.test.web.servlet.client.MockMvcHttpConnector
- consumeWith(Consumer<EntityExchangeResult<B>>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.BodySpec
-
Assert the exchange result with the given
Consumer
. - consumeWith(Consumer<EntityExchangeResult<byte[]>>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.BodyContentSpec
-
Assert the response body content with the given
Consumer
. - consumeWith(Consumer<FluxExchangeResult<T>>) - Method in class org.springframework.test.web.reactive.server.FluxExchangeResult
-
Invoke the given consumer within
ExchangeResult.assertWithDiagnostics(Runnable)
passing"this"
instance to it. - contains(E...) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.ListBodySpec
-
Assert the extracted list of values contains the given elements.
- contains(MergedContextConfiguration) - Method in interface org.springframework.test.context.cache.ContextCache
-
Determine whether there is a cached context for the given key.
- contains(MergedContextConfiguration) - Method in class org.springframework.test.context.cache.DefaultContextCache
- containsHeader(String) - Method in class org.springframework.mock.web.MockHttpServletResponse
- content() - Static method in class org.springframework.test.web.client.match.MockRestRequestMatchers
-
Access to request body matchers.
- content() - Static method in class org.springframework.test.web.servlet.result.MockMvcResultMatchers
-
Access to response body assertions.
- content(byte[]) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Set the request body.
- content(String) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Set the request body as a UTF-8 String.
- contentDisposition(ContentDisposition) - Method in class org.springframework.test.web.reactive.server.HeaderAssertions
-
Expect a "Content-Disposition" header with the given value.
- contentLength(long) - Method in interface org.springframework.mock.http.server.reactive.MockServerHttpRequest.BodyBuilder
-
Set the length of the body in bytes, as specified by the
Content-Length
header. - contentLength(long) - Method in class org.springframework.test.web.reactive.server.HeaderAssertions
-
Expect a "Content-Length" header with the given value.
- contentLength(long) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.RequestBodySpec
-
Set the length of the body in bytes, as specified by the
Content-Length
header. - contentNegotiationManager(ContentNegotiationManager) - Method in interface org.springframework.test.web.servlet.client.MockMvcWebTestClient.ControllerSpec
-
Set a ContentNegotiationManager.
- ContentRequestMatchers - Class in org.springframework.test.web.client.match
-
Factory for request content
RequestMatcher
's. - ContentRequestMatchers() - Constructor for class org.springframework.test.web.client.match.ContentRequestMatchers
-
Class constructor, not for direct instantiation.
- ContentResultMatchers - Class in org.springframework.test.web.servlet.result
-
Factory for response content assertions.
- ContentResultMatchers() - Constructor for class org.springframework.test.web.servlet.result.ContentResultMatchers
-
Protected constructor.
- contentType(String) - Method in class org.springframework.test.web.client.match.ContentRequestMatchers
-
Assert the request content type as a String.
- contentType(String) - Method in class org.springframework.test.web.reactive.server.HeaderAssertions
-
Expect a "Content-Type" header with the given value.
- contentType(String) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Set the 'Content-Type' header of the request as a raw String value, possibly not even well-formed (for testing purposes).
- contentType(String) - Method in class org.springframework.test.web.servlet.result.ContentResultMatchers
-
Assert the ServletResponse content type.
- contentType(MediaType) - Method in interface org.springframework.mock.http.server.reactive.MockServerHttpRequest.BodyBuilder
-
Set the media type of the body, as specified by the
Content-Type
header. - contentType(MediaType) - Method in class org.springframework.test.web.client.match.ContentRequestMatchers
-
Assert the request content type as a
MediaType
. - contentType(MediaType) - Method in class org.springframework.test.web.client.response.DefaultResponseCreator
-
Set the
Content-Type
header. - contentType(MediaType) - Method in class org.springframework.test.web.reactive.server.HeaderAssertions
-
Expect a "Content-Type" header with the given value.
- contentType(MediaType) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.RequestBodySpec
-
Set the media type of the body, as specified by the
Content-Type
header. - contentType(MediaType) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Set the 'Content-Type' header of the request.
- contentType(MediaType) - Method in class org.springframework.test.web.servlet.result.ContentResultMatchers
-
Assert the ServletResponse content type after parsing it as a MediaType.
- contentTypeCompatibleWith(String) - Method in class org.springframework.test.web.client.match.ContentRequestMatchers
-
Assert the request content type is compatible with the given content type as defined by
MediaType.isCompatibleWith(MediaType)
. - contentTypeCompatibleWith(String) - Method in class org.springframework.test.web.reactive.server.HeaderAssertions
-
Expect a "Content-Type" header compatible with the given value.
- contentTypeCompatibleWith(String) - Method in class org.springframework.test.web.servlet.result.ContentResultMatchers
-
Assert the ServletResponse content type is compatible with the given content type as defined by
MediaType.isCompatibleWith(MediaType)
. - contentTypeCompatibleWith(MediaType) - Method in class org.springframework.test.web.client.match.ContentRequestMatchers
-
Assert the request content type is compatible with the given content type as defined by
MediaType.isCompatibleWith(MediaType)
. - contentTypeCompatibleWith(MediaType) - Method in class org.springframework.test.web.reactive.server.HeaderAssertions
-
Expect a "Content-Type" header compatible with the given value.
- contentTypeCompatibleWith(MediaType) - Method in class org.springframework.test.web.servlet.result.ContentResultMatchers
-
Assert the ServletResponse content type is compatible with the given content type as defined by
MediaType.isCompatibleWith(MediaType)
. - contentTypeResolver(Consumer<RequestedContentTypeResolverBuilder>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.ControllerSpec
-
Customize content type resolution.
- CONTEXT_CACHE_LOGGING_CATEGORY - Static variable in interface org.springframework.test.context.cache.ContextCache
-
The name of the logging category used for reporting
ContextCache
statistics. - CONTEXT_FAILURE_THRESHOLD_PROPERTY_NAME - Static variable in interface org.springframework.test.context.CacheAwareContextLoaderDelegate
-
System property used to configure the failure threshold for errors encountered while attempting to load an application context: "spring.test.context.failure.threshold".
- ContextCache - Interface in org.springframework.test.context.cache
-
ContextCache
defines the SPI for caching SpringApplicationContexts
within the Spring TestContext Framework. - ContextCacheUtils - Class in org.springframework.test.context.cache
-
Collection of utilities for working with context caching.
- ContextCacheUtils() - Constructor for class org.springframework.test.context.cache.ContextCacheUtils
- ContextConfiguration - Annotation Interface in org.springframework.test.context
-
@ContextConfiguration
defines class-level metadata that is used to determine how to load and configure anApplicationContext
for integration tests. - ContextConfigurationAttributes - Class in org.springframework.test.context
-
ContextConfigurationAttributes
encapsulates the context configuration attributes declared via@ContextConfiguration
. - ContextConfigurationAttributes(Class<?>) - Constructor for class org.springframework.test.context.ContextConfigurationAttributes
-
Construct a new
ContextConfigurationAttributes
instance with default values. - ContextConfigurationAttributes(Class<?>, String[], Class<?>[], boolean, Class<? extends ApplicationContextInitializer<?>>[], boolean, Class<? extends ContextLoader>) - Constructor for class org.springframework.test.context.ContextConfigurationAttributes
-
Construct a new
ContextConfigurationAttributes
instance for the test class that declared the@ContextConfiguration
annotation and its corresponding attributes. - ContextConfigurationAttributes(Class<?>, String[], Class<?>[], boolean, Class<? extends ApplicationContextInitializer<?>>[], boolean, String, Class<? extends ContextLoader>) - Constructor for class org.springframework.test.context.ContextConfigurationAttributes
-
Construct a new
ContextConfigurationAttributes
instance for the test class that declared the@ContextConfiguration
annotation and its corresponding attributes. - ContextConfigurationAttributes(Class<?>, AnnotationAttributes) - Constructor for class org.springframework.test.context.ContextConfigurationAttributes
-
Construct a new
ContextConfigurationAttributes
instance for the suppliedAnnotationAttributes
(parsed from a@ContextConfiguration
annotation) and the test class that declared them. - ContextConfigurationAttributes(Class<?>, ContextConfiguration) - Constructor for class org.springframework.test.context.ContextConfigurationAttributes
-
Construct a new
ContextConfigurationAttributes
instance for the supplied@ContextConfiguration
annotation and the test class that declared it. - ContextCustomizer - Interface in org.springframework.test.context
-
Strategy interface for customizing
application contexts
that are created and managed by the Spring TestContext Framework. - ContextCustomizerFactories - Annotation Interface in org.springframework.test.context
-
@ContextCustomizerFactories
defines class-level metadata for configuring whichContextCustomizerFactory
implementations should be registered with the Spring TestContext Framework. - ContextCustomizerFactories.MergeMode - Enum Class in org.springframework.test.context
-
Enumeration of modes that dictate whether explicitly declared factories are merged with the default factories when
@ContextCustomizerFactories
is declared on a class that does not inherit factories from a superclass or enclosing class. - ContextCustomizerFactory - Interface in org.springframework.test.context
-
Factory for creating
ContextCustomizers
. - ContextHierarchy - Annotation Interface in org.springframework.test.context
-
@ContextHierarchy
is a class-level annotation that is used to define a hierarchy ofApplicationContexts
for integration tests. - ContextLoader - Interface in org.springframework.test.context
-
Strategy interface for loading an
ApplicationContext
for an integration test managed by the Spring TestContext Framework. - ContextLoadException - Exception in org.springframework.test.context
-
Exception thrown when an error occurs while a
SmartContextLoader
attempts to load anApplicationContext
. - ContextLoadException(ApplicationContext, Throwable) - Constructor for exception org.springframework.test.context.ContextLoadException
- contextPath(String) - Method in interface org.springframework.mock.http.server.reactive.MockServerHttpRequest.BaseBuilder
-
Set the contextPath to return.
- contextPath(String) - Method in interface org.springframework.mock.web.reactive.function.server.MockServerRequest.Builder
- contextPath(String) - Method in class org.springframework.test.web.servlet.htmlunit.MockMvcWebConnectionBuilderSupport
-
Set the context path to use.
- contextPath(String) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Specify the portion of the requestURI that represents the context path.
- CONTINUE_ON_ERROR - Enum constant in enum class org.springframework.test.context.jdbc.SqlConfig.ErrorMode
-
Indicates that all errors in SQL scripts should be logged but not propagated as exceptions.
- controllerAdvice(Object...) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.ControllerSpec
-
Register one or more
ControllerAdvice
instances to be used in tests (specifiedClass
will be turned into instance). - controllerAdvice(Object...) - Method in interface org.springframework.test.web.servlet.client.MockMvcWebTestClient.ControllerSpec
-
Register
ControllerAdvice
- conversionService(FormattingConversionService) - Method in interface org.springframework.test.web.servlet.client.MockMvcWebTestClient.ControllerSpec
-
Provide a conversion service.
- convertInlinedPropertiesToMap(String...) - Static method in class org.springframework.test.context.support.TestPropertySourceUtils
-
Convert the supplied inlined properties (in the form of key-value pairs) into a map keyed by property name.
- convertToClasspathResourcePaths(Class<?>, boolean, String...) - Static method in class org.springframework.test.context.util.TestContextResourceUtils
-
Convert the supplied paths to classpath resource paths.
- convertToClasspathResourcePaths(Class<?>, String...) - Static method in class org.springframework.test.context.util.TestContextResourceUtils
-
Convert the supplied paths to classpath resource paths.
- convertToResourceList(ResourceLoader, String...) - Static method in class org.springframework.test.context.util.TestContextResourceUtils
-
Convert the supplied paths to a list of
Resource
handles using the givenResourceLoader
. - convertToResources(ResourceLoader, String...) - Static method in class org.springframework.test.context.util.TestContextResourceUtils
-
Convert the supplied paths to an array of
Resource
handles using the givenResourceLoader
. - cookie() - Static method in class org.springframework.test.web.servlet.result.MockMvcResultMatchers
-
Access to response cookie assertions.
- cookie(Cookie...) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Add the given cookies to the request.
- cookie(String, String) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.RequestHeadersSpec
-
Add a cookie with the given name and value.
- cookie(HttpCookie...) - Method in interface org.springframework.mock.http.server.reactive.MockServerHttpRequest.BaseBuilder
-
Add one or more cookies.
- cookie(HttpCookie...) - Method in interface org.springframework.mock.web.reactive.function.server.MockServerRequest.Builder
- CookieAssertions - Class in org.springframework.test.web.reactive.server
-
Assertions on cookies of the response.
- CookieAssertions(ExchangeResult, WebTestClient.ResponseSpec) - Constructor for class org.springframework.test.web.reactive.server.CookieAssertions
- CookieResultMatchers - Class in org.springframework.test.web.servlet.result
-
Factory for response cookie assertions.
- CookieResultMatchers() - Constructor for class org.springframework.test.web.servlet.result.CookieResultMatchers
-
Protected constructor.
- cookies() - Method in class org.springframework.mock.web.reactive.function.server.MockServerRequest
- cookies(Consumer<MultiValueMap<String, String>>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.RequestHeadersSpec
-
Manipulate this request's cookies with the given consumer.
- cookies(ResponseCookie...) - Method in class org.springframework.test.web.client.response.DefaultResponseCreator
-
Add one or more cookies.
- cookies(MultiValueMap<String, HttpCookie>) - Method in interface org.springframework.mock.http.server.reactive.MockServerHttpRequest.BaseBuilder
-
Add the given cookies.
- cookies(MultiValueMap<String, HttpCookie>) - Method in interface org.springframework.mock.web.reactive.function.server.MockServerRequest.Builder
- cookies(MultiValueMap<String, ResponseCookie>) - Method in class org.springframework.test.web.client.response.DefaultResponseCreator
-
Copy all cookies from the given
MultiValueMap
. - corsMappings(Consumer<CorsRegistry>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.ControllerSpec
-
Configure CORS support.
- countRowsInTable(String) - Method in class org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests
-
Convenience method for counting the rows in the given table.
- countRowsInTable(String) - Method in class org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests
-
Convenience method for counting the rows in the given table.
- countRowsInTable(JdbcOperations, String) - Static method in class org.springframework.test.jdbc.JdbcTestUtils
-
Count the rows in the given table.
- countRowsInTable(JdbcClient, String) - Static method in class org.springframework.test.jdbc.JdbcTestUtils
-
Count the rows in the given table.
- countRowsInTableWhere(String, String) - Method in class org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests
-
Convenience method for counting the rows in the given table, using the provided
WHERE
clause. - countRowsInTableWhere(String, String) - Method in class org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests
-
Convenience method for counting the rows in the given table, using the provided
WHERE
clause. - countRowsInTableWhere(JdbcOperations, String, String) - Static method in class org.springframework.test.jdbc.JdbcTestUtils
-
Count the rows in the given table, using the provided
WHERE
clause. - countRowsInTableWhere(JdbcClient, String, String) - Static method in class org.springframework.test.jdbc.JdbcTestUtils
-
Count the rows in the given table, using the provided
WHERE
clause. - createBeanDefinitionReader(GenericApplicationContext) - Method in class org.springframework.test.context.support.AbstractGenericContextLoader
-
Factory method for creating a new
BeanDefinitionReader
for loading bean definitions into the suppliedcontext
. - createBeanDefinitionReader(GenericApplicationContext) - Method in class org.springframework.test.context.support.AnnotationConfigContextLoader
-
AnnotationConfigContextLoader
should be used as aSmartContextLoader
, not as a legacyContextLoader
. - createBeanDefinitionReader(GenericApplicationContext) - Method in class org.springframework.test.context.support.GenericXmlContextLoader
-
Create a new
XmlBeanDefinitionReader
. - createConnection(WebClient) - Method in class org.springframework.test.web.servlet.htmlunit.MockMvcWebConnectionBuilderSupport
-
Create a new
WebConnection
that will use aMockMvc
instance if one of the specifiedWebRequestMatcher
instances matches. - createContext() - Method in class org.springframework.test.context.support.AbstractGenericContextLoader
-
Factory method for creating the
GenericApplicationContext
used by thisContextLoader
. - createContext() - Method in class org.springframework.test.context.web.AbstractGenericWebContextLoader
-
Factory method for creating the
GenericWebApplicationContext
used by thisContextLoader
. - createContextCustomizer(Class<?>, List<ContextConfigurationAttributes>) - Method in interface org.springframework.test.context.ContextCustomizerFactory
-
Create a
ContextCustomizer
that should be used to customize aConfigurableApplicationContext
before it is refreshed. - CREATED_BY_THE_TESTCONTEXT_FRAMEWORK - Static variable in class org.springframework.test.context.web.ServletTestExecutionListener
-
Attribute name for a request attribute which indicates that the
MockHttpServletRequest
stored in theRequestAttributes
in Spring Web'sRequestContextHolder
was created by the TestContext framework. - createDelegatingTransactionAttribute(TestContext, TransactionAttribute) - Static method in class org.springframework.test.context.transaction.TestContextTransactionUtils
-
Create a delegating
TransactionAttribute
for the supplied targetTransactionAttribute
andTestContext
, using the names of the test class and test method to build the name of the transaction. - createDelegatingTransactionAttribute(TestContext, TransactionAttribute, boolean) - Static method in class org.springframework.test.context.transaction.TestContextTransactionUtils
-
Create a delegating
TransactionAttribute
for the supplied targetTransactionAttribute
andTestContext
, using the names of the test class and test method (if requested) to build the name of the transaction. - createFilter(Class<T>) - Method in class org.springframework.mock.web.MockServletContext
- createListener(Class<T>) - Method in class org.springframework.mock.web.MockAsyncContext
- createListener(Class<T>) - Method in class org.springframework.mock.web.MockServletContext
- createMockMvc(Filter[], MockServletConfig, WebApplicationContext, RequestBuilder, Charset, List<ResultMatcher>, List<ResultHandler>, List<DispatcherServletCustomizer>) - Method in class org.springframework.test.web.servlet.MockMvcBuilderSupport
-
Delegates to
MockMvcBuilderSupport.createMockMvc(Filter[], MockServletConfig, WebApplicationContext, RequestBuilder, List, List, List)
for creation of theMockMvc
instance and configures that instance with the supplieddefaultResponseCharacterEncoding
. - createMockMvc(Filter[], MockServletConfig, WebApplicationContext, RequestBuilder, List<ResultMatcher>, List<ResultHandler>, List<DispatcherServletCustomizer>) - Method in class org.springframework.test.web.servlet.MockMvcBuilderSupport
- createRequest(URI, HttpMethod) - Method in class org.springframework.test.web.client.MockMvcClientHttpRequestFactory
- createResponse(ClientHttpRequest) - Method in class org.springframework.test.web.client.DefaultRequestExpectation
-
Note that as of 5.0.3, the creation of the response, which may block intentionally, is separated from request count tracking, and this method no longer increments the count transparently.
- createResponse(ClientHttpRequest) - Method in class org.springframework.test.web.client.response.DefaultResponseCreator
- createResponse(ClientHttpRequest) - Method in class org.springframework.test.web.client.response.ExecutingResponseCreator
- createResponse(ClientHttpRequest) - Method in interface org.springframework.test.web.client.ResponseCreator
-
Create a response for the given request.
- createServer(RestTemplate) - Static method in class org.springframework.test.web.client.MockRestServiceServer
-
A shortcut for
bindTo(restTemplate).build()
. - createServer(RestGatewaySupport) - Static method in class org.springframework.test.web.client.MockRestServiceServer
-
A shortcut for
bindTo(restGateway).build()
. - createServlet(Class<T>) - Method in class org.springframework.mock.web.MockServletContext
- createServletRequest(ServletContext) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Create a new
MockHttpServletRequest
based on the suppliedServletContext
. - createServletRequest(ServletContext) - Method in class org.springframework.test.web.servlet.request.MockMultipartHttpServletRequestBuilder
-
Create a new
MockMultipartHttpServletRequest
based on the suppliedServletContext
and theMockMultipartFiles
added to this builder. - createTest() - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
-
Delegate to the parent implementation for creating the test instance and then allow the
TestContextManager
to prepare the test instance before returning it. - createTestContextManager(Class<?>) - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
-
Create a new
TestContextManager
for the supplied test class. - createUnexpectedRequestError(ClientHttpRequest) - Method in class org.springframework.test.web.client.AbstractRequestExpectationManager
-
Return an
AssertionError
that a subclass can raise for an unexpected request. - CURRENT_LEVEL - Enum constant in enum class org.springframework.test.annotation.DirtiesContext.HierarchyMode
-
The
ApplicationContext
for the current level in the context hierarchy and all contexts in subhierarchies of the current level will be removed from the context cache and closed. - customArgumentResolvers(HandlerMethodArgumentResolver...) - Method in interface org.springframework.test.web.servlet.client.MockMvcWebTestClient.ControllerSpec
-
Provide custom argument resolvers.
- customHandlerMapping(Supplier<RequestMappingHandlerMapping>) - Method in interface org.springframework.test.web.servlet.client.MockMvcWebTestClient.ControllerSpec
-
Configure factory for a custom
RequestMappingHandlerMapping
. - customize(DispatcherServlet) - Method in interface org.springframework.test.web.servlet.DispatcherServletCustomizer
-
Customize the supplied
DispatcherServlet
before it is initialized. - customizeBeanFactory(DefaultListableBeanFactory) - Method in class org.springframework.test.context.support.AbstractGenericContextLoader
-
Customize the internal bean factory of the ApplicationContext created by this
ContextLoader
. - customizeBeanFactory(DefaultListableBeanFactory, WebMergedContextConfiguration) - Method in class org.springframework.test.context.web.AbstractGenericWebContextLoader
-
Customize the internal bean factory of the
WebApplicationContext
created by this context loader. - customizeContext(ConfigurableApplicationContext, MergedContextConfiguration) - Method in interface org.springframework.test.context.ContextCustomizer
-
Customize the supplied
ConfigurableApplicationContext
after bean definitions have been loaded into the context but before the context has been refreshed. - customizeContext(ConfigurableApplicationContext, MergedContextConfiguration) - Method in class org.springframework.test.context.support.AbstractContextLoader
-
Customize the
ConfigurableApplicationContext
created by thisContextLoader
after bean definitions have been loaded into the context but before the context has been refreshed. - customizeContext(GenericApplicationContext) - Method in class org.springframework.test.context.support.AbstractGenericContextLoader
-
Customize the
GenericApplicationContext
created by thisContextLoader
after bean definitions have been loaded into the context but before the context is refreshed. - customizeContext(GenericWebApplicationContext, WebMergedContextConfiguration) - Method in class org.springframework.test.context.web.AbstractGenericWebContextLoader
-
Customize the
GenericWebApplicationContext
created by this context loader after bean definitions have been loaded into the context but before the context is refreshed. - customReturnValueHandlers(HandlerMethodReturnValueHandler...) - Method in interface org.springframework.test.web.servlet.client.MockMvcWebTestClient.ControllerSpec
-
Provide custom return value handlers.
D
- dataSource() - Element in annotation interface org.springframework.test.context.jdbc.SqlConfig
-
The bean name of the
DataSource
against which the scripts should be executed. - dateValue(String, long) - Method in class org.springframework.test.web.servlet.result.HeaderResultMatchers
-
Assert the primary value of the named response header parsed into a date using the preferred date format described in RFC 7231.
- declareRoles(String...) - Method in class org.springframework.mock.web.MockServletContext
- DEFAULT - Enum constant in enum class org.springframework.test.context.jdbc.SqlConfig.ErrorMode
-
Indicates that the default error mode should be used.
- DEFAULT - Enum constant in enum class org.springframework.test.context.jdbc.SqlConfig.TransactionMode
-
Indicates that the default transaction mode should be used.
- DEFAULT_CONTEXT_FAILURE_THRESHOLD - Static variable in interface org.springframework.test.context.CacheAwareContextLoaderDelegate
-
The default failure threshold for errors encountered while attempting to load an application context: 1.
- DEFAULT_DATA_SOURCE_NAME - Static variable in class org.springframework.test.context.transaction.TestContextTransactionUtils
-
Default bean name for a
DataSource
:"dataSource"
. - DEFAULT_INVOKER - Static variable in interface org.springframework.test.context.MethodInvoker
-
Shared instance of the default
MethodInvoker
. - DEFAULT_MAX_CONTEXT_CACHE_SIZE - Static variable in interface org.springframework.test.context.cache.ContextCache
-
The default maximum size of the context cache: 32.
- DEFAULT_PROTOCOL - Static variable in class org.springframework.mock.web.MockHttpServletRequest
-
The default protocol: 'HTTP/1.1'.
- DEFAULT_REMOTE_ADDR - Static variable in class org.springframework.mock.web.MockHttpServletRequest
-
The default remote address: '127.0.0.1'.
- DEFAULT_REMOTE_HOST - Static variable in class org.springframework.mock.web.MockHttpServletRequest
-
The default remote host: 'localhost'.
- DEFAULT_SCHEME - Static variable in class org.springframework.mock.web.MockHttpServletRequest
-
The default scheme: 'http'.
- DEFAULT_SERVER_ADDR - Static variable in class org.springframework.mock.web.MockHttpServletRequest
-
The default server address: '127.0.0.1'.
- DEFAULT_SERVER_NAME - Static variable in class org.springframework.mock.web.MockHttpServletRequest
-
The default server name: 'localhost'.
- DEFAULT_SERVER_PORT - Static variable in class org.springframework.mock.web.MockHttpServletRequest
-
The default server port: '80'.
- DEFAULT_TRANSACTION_MANAGER_NAME - Static variable in class org.springframework.test.context.transaction.TestContextTransactionUtils
-
Default bean name for a
PlatformTransactionManager
:"transactionManager"
. - DefaultActiveProfilesResolver - Class in org.springframework.test.context.support
-
Default implementation of the
ActiveProfilesResolver
strategy that resolves active bean definition profiles based solely on profiles configured declaratively viaActiveProfiles.profiles()
orActiveProfiles.value()
. - DefaultActiveProfilesResolver() - Constructor for class org.springframework.test.context.support.DefaultActiveProfilesResolver
- DefaultBootstrapContext - Class in org.springframework.test.context.support
-
Default implementation of the
BootstrapContext
interface. - DefaultBootstrapContext(Class<?>, CacheAwareContextLoaderDelegate) - Constructor for class org.springframework.test.context.support.DefaultBootstrapContext
-
Construct a new
DefaultBootstrapContext
from the supplied arguments. - DefaultCacheAwareContextLoaderDelegate - Class in org.springframework.test.context.cache
-
Default implementation of the
CacheAwareContextLoaderDelegate
strategy. - DefaultCacheAwareContextLoaderDelegate() - Constructor for class org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate
-
Construct a new
DefaultCacheAwareContextLoaderDelegate
using a staticDefaultContextCache
. - DefaultCacheAwareContextLoaderDelegate(ContextCache) - Constructor for class org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate
-
Construct a new
DefaultCacheAwareContextLoaderDelegate
using the suppliedContextCache
and the default or user-configured context failure threshold. - DefaultContextCache - Class in org.springframework.test.context.cache
-
Default implementation of the
ContextCache
API. - DefaultContextCache() - Constructor for class org.springframework.test.context.cache.DefaultContextCache
-
Create a new
DefaultContextCache
using the maximum cache size obtained viaContextCacheUtils.retrieveMaxCacheSize()
. - DefaultContextCache(int) - Constructor for class org.springframework.test.context.cache.DefaultContextCache
-
Create a new
DefaultContextCache
using the supplied maximum cache size. - defaultCookie(String, String...) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.Builder
-
Add the given header to all requests that haven't added it.
- defaultCookies(Consumer<MultiValueMap<String, String>>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.Builder
-
Manipulate the default cookies with the given consumer.
- defaultHeader(String, String...) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.Builder
-
Add the given header to all requests that haven't added it.
- defaultHeaders(Consumer<HttpHeaders>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.Builder
-
Manipulate the default headers with the given consumer.
- DefaultMockMvcBuilder - Class in org.springframework.test.web.servlet.setup
-
A concrete implementation of
AbstractMockMvcBuilder
that provides theWebApplicationContext
supplied to it as a constructor argument. - DefaultMockMvcBuilder(WebApplicationContext) - Constructor for class org.springframework.test.web.servlet.setup.DefaultMockMvcBuilder
-
Protected constructor.
- defaultRequest(RequestBuilder) - Method in interface org.springframework.test.web.servlet.client.MockMvcWebTestClient.MockMvcServerSpec
-
Define default request properties that should be merged into all performed requests such that input from the client request override the default properties defined here.
- defaultRequest(RequestBuilder) - Method in class org.springframework.test.web.servlet.setup.AbstractMockMvcBuilder
- defaultRequest(RequestBuilder) - Method in interface org.springframework.test.web.servlet.setup.ConfigurableMockMvcBuilder
-
Define default request properties that should be merged into all performed requests.
- DefaultRequestExpectation - Class in org.springframework.test.web.client
-
Default implementation of
RequestExpectation
that simply delegates to the request matchers and the response creator it contains. - DefaultRequestExpectation(ExpectedCount, RequestMatcher) - Constructor for class org.springframework.test.web.client.DefaultRequestExpectation
-
Create a new request expectation that should be called a number of times as indicated by
RequestCount
. - DefaultRequestExpectation.RequestCount - Class in org.springframework.test.web.client
-
Helper class that keeps track of actual vs expected request count.
- defaultResponseCharacterEncoding(Charset) - Method in class org.springframework.test.web.servlet.setup.AbstractMockMvcBuilder
-
Define the default character encoding to be applied to every response.
- defaultResponseCharacterEncoding(Charset) - Method in interface org.springframework.test.web.servlet.setup.ConfigurableMockMvcBuilder
-
Define the default character encoding to be applied to every response.
- DefaultResponseCreator - Class in org.springframework.test.web.client.response
-
A
ResponseCreator
with builder-style methods for adding response details. - DefaultResponseCreator(int) - Constructor for class org.springframework.test.web.client.response.DefaultResponseCreator
-
Protected constructor.
- DefaultResponseCreator(HttpStatusCode) - Constructor for class org.springframework.test.web.client.response.DefaultResponseCreator
-
Protected constructor.
- DefaultTestContext - Class in org.springframework.test.context.support
-
Default implementation of the
TestContext
interface. - DefaultTestContext(Class<?>, MergedContextConfiguration, CacheAwareContextLoaderDelegate) - Constructor for class org.springframework.test.context.support.DefaultTestContext
-
Construct a new
DefaultTestContext
from the supplied arguments. - DefaultTestContext(DefaultTestContext) - Constructor for class org.springframework.test.context.support.DefaultTestContext
-
Copy constructor for creating a new
DefaultTestContext
based on the attributes and immutable state of the supplied context. - DefaultTestContextBootstrapper - Class in org.springframework.test.context.support
-
Default implementation of the
TestContextBootstrapper
SPI. - DefaultTestContextBootstrapper() - Constructor for class org.springframework.test.context.support.DefaultTestContextBootstrapper
- DelegateWebConnection(WebRequestMatcher, WebConnection) - Constructor for class org.springframework.test.web.servlet.htmlunit.DelegatingWebConnection.DelegateWebConnection
- DelegatingServletInputStream - Class in org.springframework.mock.web
-
Delegating implementation of
ServletInputStream
. - DelegatingServletInputStream(InputStream) - Constructor for class org.springframework.mock.web.DelegatingServletInputStream
-
Create a DelegatingServletInputStream for the given source stream.
- DelegatingServletOutputStream - Class in org.springframework.mock.web
-
Delegating implementation of
ServletOutputStream
. - DelegatingServletOutputStream(OutputStream) - Constructor for class org.springframework.mock.web.DelegatingServletOutputStream
-
Create a DelegatingServletOutputStream for the given target stream.
- DelegatingSmartContextLoader - Class in org.springframework.test.context.support
-
DelegatingSmartContextLoader
is a concrete implementation ofAbstractDelegatingSmartContextLoader
that delegates to aGenericXmlContextLoader
(or aGenericGroovyXmlContextLoader
if Groovy is present in the classpath) and anAnnotationConfigContextLoader
. - DelegatingSmartContextLoader() - Constructor for class org.springframework.test.context.support.DelegatingSmartContextLoader
- DelegatingWebConnection - Class in org.springframework.test.web.servlet.htmlunit
-
Implementation of
WebConnection
that allows delegating to variousWebConnection
implementations. - DelegatingWebConnection(WebConnection, List<DelegatingWebConnection.DelegateWebConnection>) - Constructor for class org.springframework.test.web.servlet.htmlunit.DelegatingWebConnection
- DelegatingWebConnection(WebConnection, DelegatingWebConnection.DelegateWebConnection...) - Constructor for class org.springframework.test.web.servlet.htmlunit.DelegatingWebConnection
- DelegatingWebConnection.DelegateWebConnection - Class in org.springframework.test.web.servlet.htmlunit
-
The delegate web connection.
- delete() - Method in class org.springframework.mock.web.MockPart
- delete() - Method in interface org.springframework.test.web.reactive.server.WebTestClient
-
Prepare an HTTP DELETE request.
- delete(String, Object...) - Static method in class org.springframework.mock.http.server.reactive.MockServerHttpRequest
-
HTTP DELETE variant.
- delete(String, Object...) - Static method in class org.springframework.test.web.servlet.request.MockMvcRequestBuilders
-
Create a
MockHttpServletRequestBuilder
for a DELETE request. - delete(URI) - Static method in class org.springframework.test.web.servlet.request.MockMvcRequestBuilders
-
Create a
MockHttpServletRequestBuilder
for a DELETE request. - deleteFromTables(String...) - Method in class org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests
-
Convenience method for deleting all rows from the specified tables.
- deleteFromTables(String...) - Method in class org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests
-
Convenience method for deleting all rows from the specified tables.
- deleteFromTables(JdbcOperations, String...) - Static method in class org.springframework.test.jdbc.JdbcTestUtils
-
Delete all rows from the specified tables.
- deleteFromTables(JdbcClient, String...) - Static method in class org.springframework.test.jdbc.JdbcTestUtils
-
Delete all rows from the specified tables.
- deleteFromTableWhere(String, String, Object...) - Method in class org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests
-
Convenience method for deleting all rows from the given table, using the provided
WHERE
clause. - deleteFromTableWhere(String, String, Object...) - Method in class org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests
-
Convenience method for deleting all rows from the given table, using the provided
WHERE
clause. - deleteFromTableWhere(JdbcOperations, String, String, Object...) - Static method in class org.springframework.test.jdbc.JdbcTestUtils
-
Delete rows from the given table, using the provided
WHERE
clause. - deleteFromTableWhere(JdbcClient, String, String, Object...) - Static method in class org.springframework.test.jdbc.JdbcTestUtils
-
Delete rows from the given table, using the provided
WHERE
clause. - DependencyInjectionTestExecutionListener - Class in org.springframework.test.context.support
-
TestExecutionListener
which provides support for dependency injection and initialization of test instances. - DependencyInjectionTestExecutionListener() - Constructor for class org.springframework.test.context.support.DependencyInjectionTestExecutionListener
- deserializeState(Serializable) - Method in class org.springframework.mock.web.MockHttpSession
-
Deserialize the attributes of this session from a state object created by
MockHttpSession.serializeState()
. - detectDefaultConfigurationClasses(Class<?>) - Method in class org.springframework.test.context.support.AnnotationConfigContextLoader
-
Detect the default configuration classes for the supplied test class.
- detectDefaultConfigurationClasses(Class<?>) - Static method in class org.springframework.test.context.support.AnnotationConfigContextLoaderUtils
-
Detect the default configuration classes for the supplied test class.
- detectDefaultConfigurationClasses(Class<?>) - Method in class org.springframework.test.context.web.AnnotationConfigWebContextLoader
-
Detect the default configuration classes for the supplied test class.
- DirtiesContext - Annotation Interface in org.springframework.test.annotation
-
Test annotation which indicates that the
ApplicationContext
associated with a test is dirty and should therefore be closed and removed from the context cache. - DirtiesContext.ClassMode - Enum Class in org.springframework.test.annotation
-
Defines modes which determine how
@DirtiesContext
is interpreted when used to annotate a test class. - DirtiesContext.HierarchyMode - Enum Class in org.springframework.test.annotation
-
Defines modes which determine how the context cache is cleared when
@DirtiesContext
is used in a test whose context is configured as part of a hierarchy via@ContextHierarchy
. - DirtiesContext.MethodMode - Enum Class in org.springframework.test.annotation
-
Defines modes which determine how
@DirtiesContext
is interpreted when used to annotate a test method. - DirtiesContextBeforeModesTestExecutionListener - Class in org.springframework.test.context.support
-
TestExecutionListener
which provides support for marking theApplicationContext
associated with a test as dirty for both test classes and test methods annotated with the@DirtiesContext
annotation. - DirtiesContextBeforeModesTestExecutionListener() - Constructor for class org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener
- DirtiesContextTestExecutionListener - Class in org.springframework.test.context.support
-
TestExecutionListener
which provides support for marking theApplicationContext
associated with a test as dirty for both test classes and test methods annotated with the@DirtiesContext
annotation. - DirtiesContextTestExecutionListener() - Constructor for class org.springframework.test.context.support.DirtiesContextTestExecutionListener
- dirtyContext(TestContext, DirtiesContext.HierarchyMode) - Method in class org.springframework.test.context.support.AbstractDirtiesContextTestExecutionListener
-
Mark the application context of the supplied test context as dirty and set
REINJECT_DEPENDENCIES_ATTRIBUTE
in the test context totrue
. - DisabledIf - Annotation Interface in org.springframework.test.context.junit.jupiter
-
@DisabledIf
is used to signal that the annotated test class or test method is disabled and should not be executed if the suppliedDisabledIf.expression()
evaluates totrue
. - DisabledIfCondition - Class in org.springframework.test.context.junit.jupiter
-
DisabledIfCondition
is anExecutionCondition
that supports the@DisabledIf
annotation when using the Spring TestContext Framework in conjunction with JUnit 5's Jupiter programming model. - DisabledIfCondition() - Constructor for class org.springframework.test.context.junit.jupiter.DisabledIfCondition
- DisabledInAotMode - Annotation Interface in org.springframework.test.context.aot
-
@DisabledInAotMode
signals that an annotated test class is disabled in Spring AOT (ahead-of-time) mode, which means that theApplicationContext
for the test class will not be processed for AOT optimizations at build time. - dispatch() - Method in class org.springframework.mock.web.MockAsyncContext
- dispatch(ServletContext, String) - Method in class org.springframework.mock.web.MockAsyncContext
- dispatch(String) - Method in class org.springframework.mock.web.MockAsyncContext
- dispatcherServletCustomizer(DispatcherServletCustomizer) - Method in interface org.springframework.test.web.servlet.client.MockMvcWebTestClient.MockMvcServerSpec
-
Allow customization of
DispatcherServlet
. - DispatcherServletCustomizer - Interface in org.springframework.test.web.servlet
-
Strategy interface for customizing
DispatcherServlet
instances that are managed byMockMvc
. - dispatchOptions(boolean) - Method in interface org.springframework.test.web.servlet.client.MockMvcWebTestClient.MockMvcServerSpec
-
Whether to handle HTTP OPTIONS requests.
- dispatchOptions(boolean) - Method in class org.springframework.test.web.servlet.setup.AbstractMockMvcBuilder
- dispatchOptions(boolean) - Method in interface org.springframework.test.web.servlet.setup.ConfigurableMockMvcBuilder
-
Whether to enable the DispatcherServlet property
dispatchOptionsRequest
which allows processing of HTTP OPTIONS requests. - doesNotContain(E...) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.ListBodySpec
-
Assert the extracted list of values doesn't contain the given elements.
- doesNotExist() - Method in class org.springframework.test.web.client.match.JsonPathRequestMatchers
-
Evaluate the JSON path expression against the request content and assert that a value does not exist at the given path.
- doesNotExist() - Method in class org.springframework.test.web.client.match.XpathRequestMatchers
-
Assert that content does not exist at the given XPath.
- doesNotExist() - Method in class org.springframework.test.web.reactive.server.JsonPathAssertions
- doesNotExist() - Method in class org.springframework.test.web.reactive.server.XpathAssertions
-
Delegates to
XpathExpectationsHelper.doesNotExist(byte[], String)
. - doesNotExist() - Method in class org.springframework.test.web.servlet.result.JsonPathResultMatchers
-
Evaluate the JSON path expression against the response content and assert that a non-null value does not exist at the given path.
- doesNotExist() - Method in class org.springframework.test.web.servlet.result.XpathResultMatchers
-
Evaluate the XPath and assert that content doesn't exist.
- doesNotExist(byte[], String) - Method in class org.springframework.test.util.XpathExpectationsHelper
-
Apply the XPath expression and assert the resulting content does not exist.
- doesNotExist(String) - Method in class org.springframework.test.util.JsonPathExpectationsHelper
-
Evaluate the JSON path expression against the supplied
content
and assert that a non-null value does not exist at the given path. - doesNotExist(String) - Method in class org.springframework.test.web.reactive.server.CookieAssertions
-
Expect that the cookie with the given name is not present.
- doesNotExist(String) - Method in class org.springframework.test.web.reactive.server.HeaderAssertions
-
Expect that the header with the given name is not present.
- doesNotExist(String) - Method in class org.springframework.test.web.servlet.result.CookieResultMatchers
-
Assert a cookie does not exist.
- doesNotExist(String) - Method in class org.springframework.test.web.servlet.result.HeaderResultMatchers
-
Assert that the named response header does not exist.
- doesNotHaveJsonPath() - Method in class org.springframework.test.web.client.match.JsonPathRequestMatchers
-
Evaluate the JSON path expression against the supplied
content
and assert that a value, includingnull
values, does not exist at the given path. - doesNotHaveJsonPath() - Method in class org.springframework.test.web.reactive.server.JsonPathAssertions
- doesNotHaveJsonPath() - Method in class org.springframework.test.web.servlet.result.JsonPathResultMatchers
-
Evaluate the JSON path expression against the supplied
content
and assert that a value, includingnull
values, does not exist at the given path. - doesNotHaveJsonPath(String) - Method in class org.springframework.test.util.JsonPathExpectationsHelper
-
Evaluate the JSON path expression against the supplied
content
and assert that a value, includingnull
values, does not exist at the given path. - doFilter(ServletRequest, ServletResponse) - Method in class org.springframework.mock.web.MockFilterChain
- doFilter(ServletRequest, ServletResponse) - Method in class org.springframework.mock.web.PassThroughFilterChain
-
Pass the call on to the Filter/Servlet.
- domain(String, String) - Method in class org.springframework.test.web.reactive.server.CookieAssertions
-
Assert a cookie's domain attribute.
- domain(String, String) - Method in class org.springframework.test.web.servlet.result.CookieResultMatchers
-
Assert a cookie's domain.
- domain(String, Matcher<? super String>) - Method in class org.springframework.test.web.reactive.server.CookieAssertions
-
Assert a cookie's domain attribute with a Hamcrest
Matcher
. - domain(String, Matcher<? super String>) - Method in class org.springframework.test.web.servlet.result.CookieResultMatchers
-
Assert a cookie's domain with a Hamcrest
Matcher
. - doProcess() - Method in class org.springframework.test.context.aot.TestAotProcessor
-
Trigger processing of the test classes by clearing output directories first and then performing AOT processing.
- dropTables(String...) - Method in class org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests
-
Convenience method for dropping all the specified tables.
- dropTables(String...) - Method in class org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests
-
Convenience method for dropping all the specified tables.
- dropTables(JdbcOperations, String...) - Static method in class org.springframework.test.jdbc.JdbcTestUtils
-
Drop the specified tables.
- dropTables(JdbcClient, String...) - Static method in class org.springframework.test.jdbc.JdbcTestUtils
-
Drop the specified tables.
- DynamicPropertyRegistry - Interface in org.springframework.test.context
-
Registry used with
@DynamicPropertySource
methods so that they can add properties to theEnvironment
that have dynamically resolved values. - DynamicPropertySource - Annotation Interface in org.springframework.test.context
-
Method-level annotation for integration tests that need to add properties with dynamic values to the
Environment
's set ofPropertySources
.
E
- EnabledIf - Annotation Interface in org.springframework.test.context.junit.jupiter
-
@EnabledIf
is used to signal that the annotated test class or test method is enabled and should be executed if the suppliedEnabledIf.expression()
evaluates totrue
. - EnabledIfCondition - Class in org.springframework.test.context.junit.jupiter
-
EnabledIfCondition
is anExecutionCondition
that supports the@EnabledIf
annotation when using the Spring TestContext Framework in conjunction with JUnit 5's Jupiter programming model. - EnabledIfCondition() - Constructor for class org.springframework.test.context.junit.jupiter.EnabledIfCondition
- ENCLOSING_CONFIGURATION_PROPERTY_NAME - Static variable in annotation interface org.springframework.test.context.NestedTestConfiguration
-
JVM system property used to change the default enclosing configuration inheritance mode: "spring.test.enclosing.configuration".
- encodeRedirectURL(String) - Method in class org.springframework.mock.web.MockHttpServletResponse
-
The default implementation delegates to
MockHttpServletResponse.encodeURL(java.lang.String)
, returning the given URL String as-is. - encodeURL(String) - Method in class org.springframework.mock.web.MockHttpServletResponse
-
The default implementation returns the given URL String as-is.
- encoding() - Element in annotation interface org.springframework.test.context.jdbc.SqlConfig
-
The encoding for the supplied SQL scripts, if different from the platform encoding.
- encoding() - Element in annotation interface org.springframework.test.context.TestPropertySource
-
Specify the character encoding for the given resources — for example, "UTF-8".
- encoding(String) - Method in class org.springframework.test.web.servlet.result.ContentResultMatchers
-
Assert the character encoding in the ServletResponse.
- encoding(Charset) - Method in class org.springframework.test.web.servlet.result.ContentResultMatchers
-
Assert the character encoding in the ServletResponse.
- end() - Static method in class org.springframework.test.context.transaction.TestTransaction
-
Immediately force a commit or rollback of the current test-managed transaction, according to the rollback flag.
- EntityExchangeResult<T> - Class in org.springframework.test.web.reactive.server
-
ExchangeResult
sub-class that exposes the response body fully extracted to a representation of type<T>
. - entityExchangeResultConsumer(Consumer<EntityExchangeResult<?>>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.Builder
-
Configure an
EntityExchangeResult
callback that is invoked every time after a response is fully decoded to a single entity, to a List of entities, or to a byte[]. - equals(Object) - Method in class org.springframework.test.context.ContextConfigurationAttributes
-
Determine if the supplied object is equal to this
ContextConfigurationAttributes
instance by comparing both object's declaring class, locations, annotated classes, inheritLocations flag, context initializer classes, inheritInitializers flag, and theContextLoader class
. - equals(Object) - Method in class org.springframework.test.context.MergedContextConfiguration
-
Determine if the supplied object is equal to this
MergedContextConfiguration
instance by comparing both objects' locations, annotated classes, context initializer classes, active profiles, property source descriptors, property source properties, context customizers, parents, and the fully qualified names of theirContextLoaders
. - equals(Object) - Method in class org.springframework.test.context.web.WebMergedContextConfiguration
-
Determine if the supplied object is equal to this
WebMergedContextConfiguration
instance by comparing both objects' locations, annotated classes, context initializer classes, active profiles, resource base paths, property source descriptors, property source properties, context customizers, parents, and the fully qualified names of theirContextLoaders
. - equals(Object) - Method in class org.springframework.test.web.reactive.server.JsonPathAssertions
- equals(Object) - Method in class org.springframework.test.web.reactive.server.XpathAssertions
- errorCount(int) - Method in class org.springframework.test.web.servlet.result.ModelResultMatchers
-
Assert the total number of errors in the model.
- errorMode() - Element in annotation interface org.springframework.test.context.jdbc.SqlConfig
-
The mode to use when an error is encountered while executing an SQL statement.
- evaluate() - Method in class org.springframework.test.context.junit4.statements.ProfileValueChecker
-
Determine if the test specified by arguments to the constructor is enabled in the current environment, as configured via the
@IfProfileValue
annotation. - evaluate() - Method in class org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks
-
Evaluate the next
Statement
in the execution chain (typically an instance ofRunAfters
), catching any exceptions thrown, and then invokeTestContextManager.afterTestClass()
. - evaluate() - Method in class org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks
-
Evaluate the next
Statement
in the execution chain (typically an instance ofRunBeforeTestExecutionCallbacks
), catching any exceptions thrown, and then invokeTestContextManager.afterTestExecution(java.lang.Object, java.lang.reflect.Method, java.lang.Throwable)
supplying the first caught exception (if any). - evaluate() - Method in class org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks
-
Evaluate the next
Statement
in the execution chain (typically an instance ofRunAfters
), catching any exceptions thrown, and then invokeTestContextManager.afterTestMethod(Object, Method, Throwable)
supplying the first caught exception (if any). - evaluate() - Method in class org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks
-
Invoke
TestContextManager.beforeTestClass()
and then evaluate the nextStatement
in the execution chain (typically an instance ofRunBefores
). - evaluate() - Method in class org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks
-
Invoke
TestContextManager.beforeTestExecution(Object, Method)
and then evaluate the nextStatement
in the execution chain (typically an instance ofInvokeMethod
). - evaluate() - Method in class org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks
-
Invoke
TestContextManager.beforeTestMethod(Object, Method)
and then evaluate the nextStatement
in the execution chain (typically an instance ofRunBefores
). - evaluate() - Method in class org.springframework.test.context.junit4.statements.RunPrepareTestInstanceCallbacks
-
Invoke
TestContextManager.prepareTestInstance(Object)
and then evaluate the nextStatement
in the execution chain (typically an instance ofRunAfterTestMethodCallbacks
). - evaluate() - Method in class org.springframework.test.context.junit4.statements.SpringFailOnTimeout
-
Evaluate the next
statement
in the execution chain (typically an instance ofSpringRepeat
) and throw aTimeoutException
if the nextstatement
executes longer than the specifiedtimeout
. - evaluate() - Method in class org.springframework.test.context.junit4.statements.SpringRepeat
-
Evaluate the next
statement
in the execution chain repeatedly, using the specified repeat count. - evaluateAnnotation(Class<A>, Function<A, String>, Function<A, String>, Function<A, Boolean>, boolean, ExtensionContext) - Method in class org.springframework.test.context.junit.jupiter.EnabledIfCondition
-
Evaluate the expression configured via the supplied annotation type on the
AnnotatedElement
for the suppliedExtensionContext
. - evaluateExecutionCondition(ExtensionContext) - Method in class org.springframework.test.context.junit.jupiter.DisabledIfCondition
-
Containers and tests are disabled if
@DisabledIf
is present on the corresponding test class or test method and the configured expression evaluates totrue
. - evaluateExecutionCondition(ExtensionContext) - Method in class org.springframework.test.context.junit.jupiter.EnabledIfCondition
-
Containers and tests are enabled if
@EnabledIf
is present on the corresponding test class or test method and the configured expression evaluates totrue
. - evaluateJsonPath(String) - Method in class org.springframework.test.util.JsonPathExpectationsHelper
-
Evaluate the JSON path and return the resulting value.
- evaluateJsonPath(String, Class<?>) - Method in class org.springframework.test.util.JsonPathExpectationsHelper
-
Variant of
JsonPathExpectationsHelper.evaluateJsonPath(String)
with a target type. - evaluateXpath(byte[], String, Class<T>) - Method in class org.springframework.test.util.XpathExpectationsHelper
-
Evaluate the XPath and return the resulting value.
- evaluateXpath(Document, QName, Class<T>) - Method in class org.springframework.test.util.XpathExpectationsHelper
-
Apply the XPath expression to given document.
- EventPublishingTestExecutionListener - Class in org.springframework.test.context.event
-
TestExecutionListener
that publishes test execution events to theApplicationContext
for the currently executing test. - EventPublishingTestExecutionListener() - Constructor for class org.springframework.test.context.event.EventPublishingTestExecutionListener
- ExceptionCollector - Class in org.springframework.test.util
-
ExceptionCollector
is a test utility for executing code blocks, collecting exceptions, and generating a singleAssertionError
containing any exceptions encountered as suppressed exceptions. - ExceptionCollector() - Constructor for class org.springframework.test.util.ExceptionCollector
- ExceptionCollector.Executable - Interface in org.springframework.test.util
-
Executable
is a functional interface that can be used to implement any generic block of code that potentially throws aThrowable
. - exchange() - Method in class org.springframework.mock.web.reactive.function.server.MockServerRequest
- exchange() - Method in interface org.springframework.test.web.reactive.server.WebTestClient.RequestHeadersSpec
-
Perform the exchange without a request body.
- exchange(ServerWebExchange) - Method in interface org.springframework.mock.web.reactive.function.server.MockServerRequest.Builder
- ExchangeResult - Class in org.springframework.test.web.reactive.server
-
Container for request and response details for exchanges performed through
WebTestClient
. - exchangeStrategies(Consumer<ExchangeStrategies.Builder>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.Builder
-
Deprecated.
- exchangeStrategies(ExchangeStrategies) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.Builder
-
Configure the
ExchangeStrategies
to use. - execute() - Method in class org.springframework.mock.http.client.MockClientHttpRequest
- execute() - Method in interface org.springframework.test.util.ExceptionCollector.Executable
- execute(ExceptionCollector.Executable) - Method in class org.springframework.test.util.ExceptionCollector
-
Execute the supplied
ExceptionCollector.Executable
and track any exception thrown. - executeInternal() - Method in class org.springframework.mock.http.client.MockClientHttpRequest
-
The default implementation returns the configured
response
. - executeSqlScript(String, boolean) - Method in class org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests
-
Execute the given SQL script.
- executeSqlScript(String, boolean) - Method in class org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests
-
Execute the given SQL script.
- ExecutingResponseCreator - Class in org.springframework.test.web.client.response
-
ResponseCreator
that obtains the response by executing the request through aClientHttpRequestFactory
. - ExecutingResponseCreator(ClientHttpRequestFactory) - Constructor for class org.springframework.test.web.client.response.ExecutingResponseCreator
-
Create an instance with the given
ClientHttpRequestFactory
. - executionPhase() - Element in annotation interface org.springframework.test.context.jdbc.Sql
-
When the SQL scripts and statements should be executed.
- EXHAUSTIVE - Enum constant in enum class org.springframework.test.annotation.DirtiesContext.HierarchyMode
-
The context cache will be cleared using an exhaustive algorithm that includes not only the current level but also all other context hierarchies that share an ancestor context common to the current test.
- exists() - Method in class org.springframework.test.web.client.match.JsonPathRequestMatchers
-
Evaluate the JSON path expression against the request content and assert that a non-null value exists at the given path.
- exists() - Method in class org.springframework.test.web.client.match.XpathRequestMatchers
-
Assert that content exists at the given XPath.
- exists() - Method in class org.springframework.test.web.reactive.server.JsonPathAssertions
- exists() - Method in class org.springframework.test.web.reactive.server.XpathAssertions
-
Delegates to
XpathExpectationsHelper.exists(byte[], String)
. - exists() - Method in class org.springframework.test.web.servlet.result.JsonPathResultMatchers
-
Evaluate the JSON path expression against the response content and assert that a non-null value, possibly an empty array or map, exists at the given path.
- exists() - Method in class org.springframework.test.web.servlet.result.XpathResultMatchers
-
Evaluate the XPath and assert that content exists.
- exists(byte[], String) - Method in class org.springframework.test.util.XpathExpectationsHelper
-
Apply the XPath expression and assert the resulting content exists.
- exists(String) - Method in class org.springframework.test.util.JsonPathExpectationsHelper
-
Evaluate the JSON path expression against the supplied
content
and assert that a non-null value, possibly an empty array or map, exists at the given path. - exists(String) - Method in class org.springframework.test.web.reactive.server.CookieAssertions
-
Expect that the cookie with the given name is present.
- exists(String) - Method in class org.springframework.test.web.reactive.server.HeaderAssertions
-
Expect that the header with the given name is present.
- exists(String) - Method in class org.springframework.test.web.servlet.result.CookieResultMatchers
-
Assert a cookie exists.
- exists(String) - Method in class org.springframework.test.web.servlet.result.HeaderResultMatchers
-
Assert that the named response header exists.
- expect(ExpectedCount, RequestMatcher) - Method in class org.springframework.test.web.client.MockRestServiceServer
-
An alternative to
MockRestServiceServer.expect(RequestMatcher)
that also indicates how many times the request is expected to be executed. - expect(RequestMatcher) - Method in class org.springframework.test.web.client.MockRestServiceServer
-
Set up an expectation for a single HTTP request.
- expectAll(WebTestClient.ResponseSpec.ResponseSpecConsumer...) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.ResponseSpec
-
Apply multiple assertions to a response with the given consumers, with the guarantee that all assertions will be applied even if one or more assertions fails with an exception.
- expectBody() - Method in interface org.springframework.test.web.reactive.server.WebTestClient.ResponseSpec
-
Consume and decode the response body to
byte[]
and then apply assertions on the raw content (e.g. - expectBody(Class<B>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.ResponseSpec
-
Consume and decode the response body to a single object of type
<B>
and then apply assertions. - expectBody(ParameterizedTypeReference<B>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.ResponseSpec
-
Alternative to
WebTestClient.ResponseSpec.expectBody(Class)
that accepts information about a target type with generics. - expectBodyList(Class<E>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.ResponseSpec
-
Consume and decode the response body to
List<E>
and then apply List-specific assertions. - expectBodyList(ParameterizedTypeReference<E>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.ResponseSpec
-
Alternative to
WebTestClient.ResponseSpec.expectBodyList(Class)
that accepts information about a target type with generics. - expectCookie() - Method in interface org.springframework.test.web.reactive.server.WebTestClient.ResponseSpec
-
Assertions on the cookies of the response.
- ExpectedCount - Class in org.springframework.test.web.client
-
A simple type representing a range for an expected count.
- expectHeader() - Method in interface org.springframework.test.web.reactive.server.WebTestClient.ResponseSpec
-
Assertions on the headers of the response.
- expectRequest(ExpectedCount, RequestMatcher) - Method in class org.springframework.test.web.client.AbstractRequestExpectationManager
- expectRequest(ExpectedCount, RequestMatcher) - Method in interface org.springframework.test.web.client.RequestExpectationManager
-
Set up a new request expectation.
- expectStatus() - Method in interface org.springframework.test.web.reactive.server.WebTestClient.ResponseSpec
-
Assertions on the response status.
- expires(long) - Method in class org.springframework.test.web.reactive.server.HeaderAssertions
-
Expect an "Expires" header with the given value.
- expression() - Element in annotation interface org.springframework.test.context.junit.jupiter.DisabledIf
-
The expression that will be evaluated to determine if the annotated test class or test method is disabled.
- expression() - Element in annotation interface org.springframework.test.context.junit.jupiter.EnabledIf
-
The expression that will be evaluated to determine if the annotated test class or test method is enabled.
- extendMvcSingletons(ServletContext) - Method in class org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder
-
This method could be used from a subclass to register additional Spring MVC infrastructure such as additional
HandlerMapping
,HandlerAdapter
, and others.
F
- factories() - Element in annotation interface org.springframework.test.context.ContextCustomizerFactories
-
The
ContextCustomizerFactory
implementations to register. - factory() - Element in annotation interface org.springframework.test.context.TestPropertySource
-
Specify a custom
PropertySourceFactory
, if any. - fail(String) - Static method in class org.springframework.test.util.AssertionErrors
-
Fail a test with the given message.
- fail(String, Object, Object) - Static method in class org.springframework.test.util.AssertionErrors
-
Fail a test with the given message passing along expected and actual values to be appended to the message.
- FAIL_ON_ERROR - Enum constant in enum class org.springframework.test.context.jdbc.SqlConfig.ErrorMode
-
Indicates that script execution will fail if an error is encountered.
- FAIL_ON_ERROR_PROPERTY_NAME - Static variable in class org.springframework.test.context.aot.TestContextAotGenerator
-
JVM system property used to set the
failOnError
flag: "spring.test.aot.processing.failOnError". - file(String, byte[]) - Method in class org.springframework.test.web.servlet.request.MockMultipartHttpServletRequestBuilder
-
Add a new
MockMultipartFile
with the given content. - file(MockMultipartFile) - Method in class org.springframework.test.web.servlet.request.MockMultipartHttpServletRequestBuilder
-
Add the given
MockMultipartFile
. - filter(Filter, String...) - Method in interface org.springframework.test.web.servlet.client.MockMvcWebTestClient.MockMvcServerSpec
-
Add a filter for specific URL patterns.
- filter(ExchangeFilterFunction) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.Builder
-
Add the given filter to the filter chain.
- filters(Filter...) - Method in interface org.springframework.test.web.servlet.client.MockMvcWebTestClient.MockMvcServerSpec
-
Add a global filter.
- filters(Consumer<List<ExchangeFilterFunction>>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.Builder
-
Manipulate the filters with the given consumer.
- findAllLocalMergedAnnotations() - Method in class org.springframework.test.context.TestContextAnnotationUtils.AnnotationDescriptor
-
Find all annotations of the specified annotation type that are present or meta-present on the root declaring class of this descriptor or on any interfaces that the root declaring class implements.
- findAllLocalMergedAnnotations() - Method in class org.springframework.test.context.TestContextAnnotationUtils.UntypedAnnotationDescriptor
-
Throws an
UnsupportedOperationException
since the type of annotation represented by anUntypedAnnotationDescriptor
is unknown. - findAnnotationDescriptor(Class<?>, Class<T>) - Static method in class org.springframework.test.context.TestContextAnnotationUtils
-
Find the
TestContextAnnotationUtils.AnnotationDescriptor
for the suppliedannotationType
on the suppliedClass
, traversing its annotations, interfaces, superclasses, and enclosing classes if no annotation can be found on the given class itself. - findAnnotationDescriptorForTypes(Class<?>, Class<? extends Annotation>...) - Static method in class org.springframework.test.context.TestContextAnnotationUtils
-
Find the
TestContextAnnotationUtils.UntypedAnnotationDescriptor
for the firstClass
in the inheritance hierarchy of the specifiedclazz
(including the specifiedclazz
itself) which declares at least one of the specifiedannotationTypes
. - findAttribute(String) - Method in class org.springframework.mock.web.MockPageContext
- findAvailableTcpPort() - Static method in class org.springframework.test.util.TestSocketUtils
-
Find an available TCP port randomly selected from the range [1024, 65535].
- findExpectation(ClientHttpRequest) - Method in class org.springframework.test.web.client.AbstractRequestExpectationManager.RequestExpectationGroup
-
Return a matching expectation, or
null
if none match. - findMergedAnnotation(Class<?>, Class<T>) - Static method in class org.springframework.test.context.TestContextAnnotationUtils
-
Find the first annotation of the specified
annotationType
within the annotation hierarchy above the supplied class, merge that annotation's attributes with matching attributes from annotations in lower levels of the annotation hierarchy, and synthesize the result back into an annotation of the specifiedannotationType
. - flagForCommit() - Static method in class org.springframework.test.context.transaction.TestTransaction
-
Flag the current test-managed transaction for commit.
- flagForRollback() - Static method in class org.springframework.test.context.transaction.TestTransaction
-
Flag the current test-managed transaction for rollback.
- flash() - Static method in class org.springframework.test.web.servlet.result.MockMvcResultMatchers
-
Access to flash attribute assertions.
- flashAttr(String, Object) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Set an "input" flash attribute.
- FlashAttributeResultMatchers - Class in org.springframework.test.web.servlet.result
-
Factory for "output" flash attribute assertions.
- FlashAttributeResultMatchers() - Constructor for class org.springframework.test.web.servlet.result.FlashAttributeResultMatchers
-
Protected constructor.
- flashAttrs(Map<String, Object>) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Set flash attributes.
- flashMapManager(FlashMapManager) - Method in interface org.springframework.test.web.servlet.client.MockMvcWebTestClient.ControllerSpec
-
Provide a custom FlashMapManager.
- flush() - Method in class org.springframework.mock.web.DelegatingServletOutputStream
- flush() - Method in class org.springframework.mock.web.MockJspWriter
- flushBuffer() - Method in class org.springframework.mock.web.MockHttpServletResponse
- FluxExchangeResult<T> - Class in org.springframework.test.web.reactive.server
-
ExchangeResult
variant with the response body decoded asFlux<T>
but not yet consumed. - formatters(Consumer<FormatterRegistry>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.ControllerSpec
-
Register formatters and converters to use for type conversion.
- formData() - Method in class org.springframework.mock.web.reactive.function.server.MockServerRequest
- formData(MultiValueMap<String, String>) - Method in class org.springframework.test.web.client.match.ContentRequestMatchers
-
Parse the body as form data and compare to the given
MultiValueMap
. - formDataContains(Map<String, String>) - Method in class org.springframework.test.web.client.match.ContentRequestMatchers
-
Variant of
ContentRequestMatchers.formData(MultiValueMap)
that matches the given subset of expected form parameters. - formField(String, String...) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Append the given value(s) to the given form field and also add them to the request parameters map.
- formFields(MultiValueMap<String, String>) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Variant of
MockHttpServletRequestBuilder.formField(String, String...)
with aMultiValueMap
. - forward(ServletRequest, ServletResponse) - Method in class org.springframework.mock.web.MockRequestDispatcher
- forward(String) - Method in class org.springframework.mock.web.MockPageContext
- forwardedUrl(String) - Static method in class org.springframework.test.web.servlet.result.MockMvcResultMatchers
-
Asserts the request was forwarded to the given URL.
- forwardedUrlPattern(String) - Static method in class org.springframework.test.web.servlet.result.MockMvcResultMatchers
-
Asserts the request was forwarded to the given URL.
- forwardedUrlTemplate(String, Object...) - Static method in class org.springframework.test.web.servlet.result.MockMvcResultMatchers
-
Asserts the request was forwarded to the given URL template.
- from(String) - Static method in enum class org.springframework.test.context.NestedTestConfiguration.EnclosingConfiguration
-
Get the
EnclosingConfiguration
enum constant with the supplied name, ignoring case. - from(String) - Static method in enum class org.springframework.test.context.TestConstructor.AutowireMode
-
Get the
AutowireMode
enum constant with the supplied name, ignoring case. - from(MockServerHttpRequest) - Static method in class org.springframework.mock.web.server.MockServerWebExchange
-
Create a
MockServerWebExchange
from the given mock request. - from(MockServerHttpRequest.BaseBuilder<?>) - Static method in class org.springframework.mock.web.server.MockServerWebExchange
-
Variant of
MockServerWebExchange.from(MockServerHttpRequest)
with a mock request builder.
G
- generateDefaultLocations(Class<?>) - Method in class org.springframework.test.context.support.AbstractContextLoader
-
Generate the default classpath resource locations array based on the supplied class.
- generateDefaultLocations(Class<?>) - Method in class org.springframework.test.context.support.AnnotationConfigContextLoader
-
AnnotationConfigContextLoader
should be used as aSmartContextLoader
, not as a legacyContextLoader
. - generateDefaultLocations(Class<?>) - Method in class org.springframework.test.context.web.AnnotationConfigWebContextLoader
-
AnnotationConfigWebContextLoader
should be used as aSmartContextLoader
, not as a legacyContextLoader
. - GenericGroovyXmlContextLoader - Class in org.springframework.test.context.support
-
Concrete implementation of
AbstractGenericContextLoader
that reads bean definitions from Groovy scripts and XML configuration files. - GenericGroovyXmlContextLoader() - Constructor for class org.springframework.test.context.support.GenericGroovyXmlContextLoader
- GenericGroovyXmlWebContextLoader - Class in org.springframework.test.context.web
-
Concrete implementation of
AbstractGenericWebContextLoader
that loads bean definitions from Groovy scripts and XML configuration files. - GenericGroovyXmlWebContextLoader() - Constructor for class org.springframework.test.context.web.GenericGroovyXmlWebContextLoader
- GenericXmlContextLoader - Class in org.springframework.test.context.support
-
Concrete implementation of
AbstractGenericContextLoader
that reads bean definitions from XML resources. - GenericXmlContextLoader() - Constructor for class org.springframework.test.context.support.GenericXmlContextLoader
- GenericXmlWebContextLoader - Class in org.springframework.test.context.web
-
Concrete implementation of
AbstractGenericWebContextLoader
that loads bean definitions from XML resources. - GenericXmlWebContextLoader() - Constructor for class org.springframework.test.context.web.GenericXmlWebContextLoader
- get() - Method in interface org.springframework.test.web.reactive.server.WebTestClient
-
Prepare an HTTP GET request.
- get(String) - Method in interface org.springframework.test.annotation.ProfileValueSource
-
Get the profile value indicated by the specified key.
- get(String) - Method in class org.springframework.test.annotation.SystemProfileValueSource
-
Get the profile value indicated by the specified key from the system properties.
- get(String) - Method in interface org.springframework.test.context.support.PropertyProvider
-
Get the value of the named property.
- get(String, Object...) - Static method in class org.springframework.mock.http.server.reactive.MockServerHttpRequest
-
Create an HTTP GET builder with the given URI template.
- get(String, Object...) - Static method in class org.springframework.test.web.servlet.request.MockMvcRequestBuilders
-
Create a
MockHttpServletRequestBuilder
for a GET request. - get(URI) - Static method in class org.springframework.test.web.servlet.request.MockMvcRequestBuilders
-
Create a
MockHttpServletRequestBuilder
for a GET request. - get(MergedContextConfiguration) - Method in interface org.springframework.test.context.cache.ContextCache
-
Obtain a cached
ApplicationContext
for the given key. - get(MergedContextConfiguration) - Method in class org.springframework.test.context.cache.DefaultContextCache
- getActiveProfiles() - Method in class org.springframework.test.context.MergedContextConfiguration
-
Get the merged active bean definition profiles for the test class.
- getAnnotation() - Method in class org.springframework.test.context.TestContextAnnotationUtils.AnnotationDescriptor
-
Get the merged annotation for this descriptor.
- getAnnotationConfigLoader() - Method in class org.springframework.test.context.support.AbstractDelegatingSmartContextLoader
-
Get the delegate
SmartContextLoader
that supports annotated classes. - getAnnotationConfigLoader() - Method in class org.springframework.test.context.support.DelegatingSmartContextLoader
- getAnnotationConfigLoader() - Method in class org.springframework.test.context.web.WebDelegatingSmartContextLoader
- getApplicationContext() - Method in exception org.springframework.test.context.ContextLoadException
-
Get the
ApplicationContext
that failed to load. - getApplicationContext() - Method in class org.springframework.test.context.support.DefaultTestContext
-
Get the application context for this test context.
- getApplicationContext() - Method in interface org.springframework.test.context.TestContext
-
Get the application context for this test context, possibly cached.
- getApplicationContext(ExtensionContext) - Static method in class org.springframework.test.context.junit.jupiter.SpringExtension
-
Get the
ApplicationContext
associated with the suppliedExtensionContext
. - getApplicationEvents() - Static method in class org.springframework.test.context.event.ApplicationEventsHolder
-
Get the
ApplicationEvents
for the current thread. - getAsyncContext() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getAsyncResult() - Method in interface org.springframework.test.web.servlet.MvcResult
-
Get the result of async execution.
- getAsyncResult(long) - Method in interface org.springframework.test.web.servlet.MvcResult
-
Get the result of async execution and wait if necessary.
- getAttribute(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
- getAttribute(String) - Method in class org.springframework.mock.web.MockHttpSession
- getAttribute(String) - Method in class org.springframework.mock.web.MockPageContext
- getAttribute(String) - Method in class org.springframework.mock.web.MockServletContext
- getAttribute(String) - Method in class org.springframework.mock.web.MockSessionCookieConfig
- getAttribute(String) - Method in class org.springframework.test.context.support.DefaultTestContext
- getAttribute(String, int) - Method in class org.springframework.mock.web.MockPageContext
- getAttributeNames() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getAttributeNames() - Method in class org.springframework.mock.web.MockHttpSession
- getAttributeNames() - Method in class org.springframework.mock.web.MockPageContext
- getAttributeNames() - Method in class org.springframework.mock.web.MockServletContext
- getAttributeNamesInScope(int) - Method in class org.springframework.mock.web.MockPageContext
- getAttributes() - Method in class org.springframework.mock.web.MockSessionCookieConfig
- getAttributes() - Method in class org.springframework.mock.web.server.MockWebSession
- getAttributesScope(String) - Method in class org.springframework.mock.web.MockPageContext
- getAuthType() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getBody() - Method in class org.springframework.mock.http.client.reactive.MockClientHttpRequest
-
Return the request body, or an error stream if the body was never set or when
MockClientHttpRequest.setWriteHandler(java.util.function.Function<reactor.core.publisher.Flux<org.springframework.core.io.buffer.DataBuffer>, reactor.core.publisher.Mono<java.lang.Void>>)
is configured. - getBody() - Method in class org.springframework.mock.http.client.reactive.MockClientHttpResponse
- getBody() - Method in class org.springframework.mock.http.MockHttpInputMessage
- getBody() - Method in class org.springframework.mock.http.MockHttpOutputMessage
- getBody() - Method in class org.springframework.mock.http.server.reactive.MockServerHttpRequest
- getBody() - Method in class org.springframework.mock.http.server.reactive.MockServerHttpResponse
-
Return the response body or an error stream if the body was not set.
- getBodyAsBytes() - Method in class org.springframework.mock.http.MockHttpOutputMessage
-
Return the body content as a byte array.
- getBodyAsString() - Method in class org.springframework.mock.http.client.reactive.MockClientHttpRequest
-
Aggregate response data and convert to a String using the "Content-Type" charset or "UTF-8" by default.
- getBodyAsString() - Method in class org.springframework.mock.http.client.reactive.MockClientHttpResponse
-
Return the response body aggregated and converted to a String using the charset of the Content-Type response or otherwise as "UTF-8".
- getBodyAsString() - Method in class org.springframework.mock.http.MockHttpOutputMessage
-
Return the body content interpreted as a UTF-8 string.
- getBodyAsString() - Method in class org.springframework.mock.http.server.reactive.MockServerHttpResponse
-
Aggregate response data and convert to a String using the "Content-Type" charset or "UTF-8" by default.
- getBodyAsString(Charset) - Method in class org.springframework.mock.http.MockHttpOutputMessage
-
Return the body content interpreted as a string using the supplied character set.
- getBoolean(String) - Method in interface org.springframework.test.context.aot.AotTestAttributes
-
Retrieve the attribute value for the given name as a
boolean
. - getBootstrapContext() - Method in class org.springframework.test.context.support.AbstractTestContextBootstrapper
- getBootstrapContext() - Method in interface org.springframework.test.context.TestContextBootstrapper
-
Get the
BootstrapContext
associated with this bootstrapper. - getBufferSize() - Method in class org.springframework.mock.web.MockHttpServletResponse
- getBytes() - Method in class org.springframework.mock.web.MockMultipartFile
- getCacheAwareContextLoaderDelegate() - Method in interface org.springframework.test.context.BootstrapContext
-
Get the
CacheAwareContextLoaderDelegate
to use for transparent interaction with theContextCache
. - getCacheAwareContextLoaderDelegate() - Method in class org.springframework.test.context.support.AbstractTestContextBootstrapper
-
Get the
CacheAwareContextLoaderDelegate
to use for transparent interaction with theContextCache
. - getCacheAwareContextLoaderDelegate() - Method in class org.springframework.test.context.support.DefaultBootstrapContext
- getCharacterEncoding() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getCharacterEncoding() - Method in class org.springframework.mock.web.MockHttpServletResponse
- getClasses() - Method in class org.springframework.test.context.ContextConfigurationAttributes
-
Get the annotated classes that were declared via
@ContextConfiguration
. - getClasses() - Method in class org.springframework.test.context.MergedContextConfiguration
-
Get the merged annotated classes for the test class.
- getClassLoader() - Method in class org.springframework.mock.web.MockServletContext
- getClasspathRoots() - Method in class org.springframework.test.context.aot.TestAotProcessor
-
Get the classpath roots to scan for test classes.
- getComment() - Method in class org.springframework.mock.web.MockSessionCookieConfig
- getCompletedResponse() - Method in exception org.springframework.test.web.reactive.server.HttpHandlerConnector.FailureAfterResponseCompletedException
- getContentAsByteArray() - Method in class org.springframework.mock.web.MockHttpServletRequest
-
Get the content of the request body as a byte array.
- getContentAsByteArray() - Method in class org.springframework.mock.web.MockHttpServletResponse
- getContentAsByteArray() - Method in class org.springframework.mock.web.MockPageContext
- getContentAsString() - Method in class org.springframework.mock.web.MockHttpServletRequest
-
Get the content of the request body as a
String
, using the configured character encoding. - getContentAsString() - Method in class org.springframework.mock.web.MockHttpServletResponse
-
Get the content of the response body as a
String
, using the charset specified for the response by the application, either throughHttpServletResponse
methods or through a charset parameter on theContent-Type
. - getContentAsString() - Method in class org.springframework.mock.web.MockPageContext
- getContentAsString(Charset) - Method in class org.springframework.mock.web.MockHttpServletResponse
-
Get the content of the response body as a
String
, using the providedfallbackCharset
if no charset has been explicitly defined and otherwise using the charset specified for the response by the application, either throughHttpServletResponse
methods or through a charset parameter on theContent-Type
. - getContentLength() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getContentLength() - Method in class org.springframework.mock.web.MockHttpServletResponse
-
Get the length of the content body from the HTTP Content-Length header.
- getContentLengthLong() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getContentLengthLong() - Method in class org.springframework.mock.web.MockHttpServletResponse
- getContentType() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getContentType() - Method in class org.springframework.mock.web.MockHttpServletResponse
- getContentType() - Method in class org.springframework.mock.web.MockMultipartFile
- getContentType() - Method in class org.springframework.mock.web.MockPart
- getContext(String) - Method in class org.springframework.mock.web.MockServletContext
- getContextCache() - Method in class org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate
-
Get the
ContextCache
used by this context loader delegate. - getContextCustomizerFactories() - Method in class org.springframework.test.context.support.AbstractTestContextBootstrapper
-
Get the
ContextCustomizerFactory
instances for this bootstrapper. - getContextCustomizers() - Method in class org.springframework.test.context.MergedContextConfiguration
-
Get the merged
ContextCustomizers
that will be applied when the application context is loaded. - getContextInitializer(Class<?>) - Method in class org.springframework.test.context.aot.AotTestContextInitializers
-
Get the AOT
ApplicationContextInitializer
for the specified test class. - getContextInitializerClass(Class<?>) - Method in class org.springframework.test.context.aot.AotTestContextInitializers
-
Get the AOT
ApplicationContextInitializer
Class
for the specified test class. - getContextInitializerClasses() - Method in class org.springframework.test.context.MergedContextConfiguration
-
Get the merged
ApplicationContextInitializer
classes for the test class. - getContextLoader() - Method in class org.springframework.test.context.MergedContextConfiguration
-
Get the resolved
ContextLoader
for the test class. - getContextLoaderClass() - Method in class org.springframework.test.context.ContextConfigurationAttributes
-
Get the
ContextLoader
class that was declared via@ContextConfiguration
. - getContextPath() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getContextPath() - Method in class org.springframework.mock.web.MockServletContext
- getCookie(String) - Method in class org.springframework.mock.web.MockHttpServletResponse
- getCookies() - Method in class org.springframework.mock.http.client.reactive.MockClientHttpResponse
- getCookies() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getCookies() - Method in class org.springframework.mock.web.MockHttpServletResponse
- getCreationTime() - Method in class org.springframework.mock.web.MockHttpSession
- getCreationTime() - Method in class org.springframework.mock.web.server.MockWebSession
- getDateHeader(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
-
Return the long timestamp for the date header with the given
name
. - getDateHeader(String) - Method in class org.springframework.mock.web.MockHttpServletResponse
- getDeclaredRoles() - Method in class org.springframework.mock.web.MockServletContext
- getDeclaringClass() - Method in class org.springframework.test.context.ContextConfigurationAttributes
-
Get the class that declared the
@ContextConfiguration
annotation, either explicitly or implicitly. - getDeclaringClass() - Method in class org.springframework.test.context.TestContextAnnotationUtils.AnnotationDescriptor
- getDefaultContextLoaderClass(Class<?>) - Method in class org.springframework.test.context.support.AbstractTestContextBootstrapper
-
Determine the default
ContextLoader
class to use for the supplied test class. - getDefaultContextLoaderClass(Class<?>) - Method in class org.springframework.test.context.support.DefaultTestContextBootstrapper
-
Returns
DelegatingSmartContextLoader
. - getDefaultContextLoaderClass(Class<?>) - Method in class org.springframework.test.context.web.WebTestContextBootstrapper
-
Returns
WebDelegatingSmartContextLoader
if the supplied class is annotated with@WebAppConfiguration
and otherwise delegates to the superclass. - getDefaultServletName() - Method in class org.springframework.mock.web.MockServletContext
-
Get the name of the default
Servlet
. - getDefaultSessionTrackingModes() - Method in class org.springframework.mock.web.MockServletContext
- getDefaultTestExecutionListeners() - Method in class org.springframework.test.context.support.AbstractTestContextBootstrapper
-
Get the default
TestExecutionListeners
for this bootstrapper. - getDescription() - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
-
Return a description suitable for an ignored test class if the test is disabled via
@IfProfileValue
at the class-level, and otherwise delegate to the parent implementation. - getDispatchedPath() - Method in class org.springframework.mock.web.MockAsyncContext
- getDispatcherServlet() - Method in class org.springframework.test.web.servlet.MockMvc
-
Return the underlying
DispatcherServlet
instance that thisMockMvc
was initialized with. - getDispatcherType() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getDomain() - Method in class org.springframework.mock.web.MockSessionCookieConfig
- getEffectiveMajorVersion() - Method in class org.springframework.mock.web.MockServletContext
- getEffectiveMinorVersion() - Method in class org.springframework.mock.web.MockServletContext
- getEffectiveSessionTrackingModes() - Method in class org.springframework.mock.web.MockServletContext
- getELContext() - Method in class org.springframework.mock.web.MockPageContext
- getErrorMessage() - Method in class org.springframework.mock.web.MockHttpServletResponse
-
Return the error message used when calling
HttpServletResponse.sendError(int, String)
. - getException() - Method in class org.springframework.mock.web.MockPageContext
- getExceptions() - Method in class org.springframework.test.util.ExceptionCollector
-
Get the list of exceptions encountered in
ExceptionCollector.execute(Executable)
. - getExpectations() - Method in class org.springframework.test.web.client.AbstractRequestExpectationManager
-
Return a read-only list of the expectations.
- getExpectations() - Method in class org.springframework.test.web.client.AbstractRequestExpectationManager.RequestExpectationGroup
- getExpectedCount() - Method in class org.springframework.test.web.client.DefaultRequestExpectation.RequestCount
- getExpectedException(FrameworkMethod) - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
-
Get the
exception
that the supplied test method is expected to throw. - getExpires() - Method in class org.springframework.mock.web.MockCookie
-
Get the "Expires" attribute for this cookie.
- getExpressionEvaluator() - Method in class org.springframework.mock.web.MockPageContext
-
Deprecated.
- getFailureCount(MergedContextConfiguration) - Method in interface org.springframework.test.context.cache.ContextCache
-
Get the failure count for the given key.
- getFailureCount(MergedContextConfiguration) - Method in class org.springframework.test.context.cache.DefaultContextCache
- getField(Class<?>, String) - Static method in class org.springframework.test.util.ReflectionTestUtils
- getField(Object, Class<?>, String) - Static method in class org.springframework.test.util.ReflectionTestUtils
- getField(Object, String) - Static method in class org.springframework.test.util.ReflectionTestUtils
- getFile(String) - Method in class org.springframework.mock.web.MockMultipartHttpServletRequest
- getFileMap() - Method in class org.springframework.mock.web.MockMultipartHttpServletRequest
- getFileNames() - Method in class org.springframework.mock.web.MockMultipartHttpServletRequest
- getFiles(String) - Method in class org.springframework.mock.web.MockMultipartHttpServletRequest
- getFilterName() - Method in class org.springframework.mock.web.MockFilterConfig
- getFilterRegistration(String) - Method in class org.springframework.mock.web.MockServletContext
-
This method always returns
null
. - getFilterRegistrations() - Method in class org.springframework.mock.web.MockServletContext
-
This method always returns an empty map.
- getFlashMap() - Method in interface org.springframework.test.web.servlet.MvcResult
-
Return the "output" flash attributes saved during request processing.
- getForwardedUrl() - Method in class org.springframework.mock.web.MockHttpServletResponse
- getHandler() - Method in interface org.springframework.test.web.servlet.MvcResult
-
Return the executed handler.
- getHeader(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
- getHeader(String) - Method in class org.springframework.mock.web.MockHttpServletResponse
-
Return the primary value for the given header as a String, if any.
- getHeader(String) - Method in class org.springframework.mock.web.MockPart
- getHeaderNames() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getHeaderNames() - Method in class org.springframework.mock.web.MockHttpServletResponse
-
Return the names of all specified headers as a Set of Strings.
- getHeaderNames() - Method in class org.springframework.mock.web.MockPart
- getHeaders() - Method in class org.springframework.mock.http.client.reactive.MockClientHttpResponse
- getHeaders() - Method in class org.springframework.mock.http.MockHttpInputMessage
- getHeaders() - Method in class org.springframework.mock.http.MockHttpOutputMessage
- getHeaders() - Method in class org.springframework.mock.web.MockPart
-
Return the
HttpHeaders
backing header related accessor methods, allowing for populating selected header entries. - getHeaders(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
- getHeaders(String) - Method in class org.springframework.mock.web.MockHttpServletResponse
-
Return all values for the given header as a List of Strings.
- getHeaders(String) - Method in class org.springframework.mock.web.MockPart
- getHeaderValue(String) - Method in class org.springframework.mock.web.MockHttpServletResponse
-
Return the primary value for the given header, if any.
- getHeaderValues(String) - Method in class org.springframework.mock.web.MockHttpServletResponse
-
Return all values for the given header as a List of value objects.
- getHitCount() - Method in interface org.springframework.test.context.cache.ContextCache
-
Get the overall hit count for this cache.
- getHitCount() - Method in class org.springframework.test.context.cache.DefaultContextCache
- getHttpServletMapping() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getId() - Method in class org.springframework.mock.web.MockHttpSession
- getId() - Method in class org.springframework.mock.web.server.MockWebSession
- getIncludedUrl() - Method in class org.springframework.mock.web.MockHttpServletResponse
- getIncludedUrls() - Method in class org.springframework.mock.web.MockHttpServletResponse
- getInitializers() - Method in class org.springframework.test.context.ContextConfigurationAttributes
-
Get the
ApplicationContextInitializer
classes that were declared via@ContextConfiguration
. - getInitParameter(String) - Method in class org.springframework.mock.web.MockFilterConfig
- getInitParameter(String) - Method in class org.springframework.mock.web.MockServletConfig
- getInitParameter(String) - Method in class org.springframework.mock.web.MockServletContext
- getInitParameterNames() - Method in class org.springframework.mock.web.MockFilterConfig
- getInitParameterNames() - Method in class org.springframework.mock.web.MockServletConfig
- getInitParameterNames() - Method in class org.springframework.mock.web.MockServletContext
- getInputStream() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getInputStream() - Method in class org.springframework.mock.web.MockMultipartFile
- getInputStream() - Method in class org.springframework.mock.web.MockPart
- getInstance() - Static method in class org.springframework.test.annotation.SystemProfileValueSource
-
Obtain the canonical instance of this ProfileValueSource.
- getInstance() - Static method in interface org.springframework.test.context.aot.AotTestAttributes
-
Get the current instance of
AotTestAttributes
to use. - getInterceptors() - Method in interface org.springframework.test.web.servlet.MvcResult
-
Return interceptors around the handler.
- getIntHeader(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
- getJspConfigDescriptor() - Method in class org.springframework.mock.web.MockServletContext
- getJUnitTimeout(FrameworkMethod) - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
- getLastAccessedTime() - Method in class org.springframework.mock.web.MockHttpSession
- getLastAccessTime() - Method in class org.springframework.mock.web.server.MockWebSession
- getListeners() - Method in class org.springframework.mock.web.MockAsyncContext
- getLocalAddr() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getLocalAddress() - Method in class org.springframework.mock.http.server.reactive.MockServerHttpRequest
- getLocale() - Method in class org.springframework.mock.web.MockHttpServletRequest
-
Return the first preferred locale configured in this mock request.
- getLocale() - Method in class org.springframework.mock.web.MockHttpServletResponse
- getLocales() - Method in class org.springframework.mock.web.MockHttpServletRequest
-
Return an enumeration of the preferred locales configured in this mock request.
- getLocalName() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getLocalPort() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getLocations() - Method in class org.springframework.test.context.ContextConfigurationAttributes
-
Get the resource locations that were declared via
@ContextConfiguration
. - getLocations() - Method in class org.springframework.test.context.MergedContextConfiguration
-
Get the merged resource locations for
ApplicationContext
configuration files for the test class. - getMajorVersion() - Method in class org.springframework.mock.web.MockServletContext
- getMappingMatch() - Method in class org.springframework.mock.web.MockHttpServletMapping
- getMatchedRequestCount() - Method in class org.springframework.test.web.client.DefaultRequestExpectation.RequestCount
- getMatchValue() - Method in class org.springframework.mock.web.MockHttpServletMapping
- getMaxAge() - Method in class org.springframework.mock.web.MockSessionCookieConfig
- getMaxCount() - Method in class org.springframework.test.web.client.ExpectedCount
-
Return the
max
boundary of the expected count range. - getMaxIdleTime() - Method in class org.springframework.mock.web.server.MockWebSession
- getMaxInactiveInterval() - Method in class org.springframework.mock.web.MockHttpSession
- getMaxSize() - Method in class org.springframework.test.context.cache.DefaultContextCache
-
Get the maximum size of this cache.
- getMergedRepeatableAnnotations(Class<?>, Class<T>) - Static method in class org.springframework.test.context.TestContextAnnotationUtils
-
Get all repeatable annotations of the specified
annotationType
within the annotation hierarchy above the supplied class; and for each annotation found, merge that annotation's attributes with matching attributes from annotations in lower levels of the annotation hierarchy and synthesize the results back into an annotation of the specifiedannotationType
. - getMethod() - Method in class org.springframework.mock.http.client.MockClientHttpRequest
- getMethod() - Method in class org.springframework.mock.http.client.reactive.MockClientHttpRequest
- getMethod() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getMethod() - Method in class org.springframework.test.web.reactive.server.ExchangeResult
-
Return the method of the request.
- getMethodInvoker() - Method in class org.springframework.test.context.support.DefaultTestContext
- getMethodInvoker() - Method in interface org.springframework.test.context.TestContext
-
Get the
MethodInvoker
to use. - getMimeType(String) - Method in class org.springframework.mock.web.MockServletContext
- getMinCount() - Method in class org.springframework.test.web.client.ExpectedCount
-
Return the
min
boundary of the expected count range. - getMinorVersion() - Method in class org.springframework.mock.web.MockServletContext
- getMissCount() - Method in interface org.springframework.test.context.cache.ContextCache
-
Get the overall miss count for this cache.
- getMissCount() - Method in class org.springframework.test.context.cache.DefaultContextCache
- getMockHttpServletResponse(ServletResponse) - Method in class org.springframework.mock.web.MockRequestDispatcher
-
Obtain the underlying
MockHttpServletResponse
, unwrappingHttpServletResponseWrapper
decorators if necessary. - getMockServerResult() - Method in class org.springframework.test.web.reactive.server.ExchangeResult
-
Return the result from the mock server exchange, if applicable, for further assertions on the state of the server response.
- getModelAndView() - Method in interface org.springframework.test.web.servlet.MvcResult
-
Return the
ModelAndView
prepared by the handler. - getMultiFileMap() - Method in class org.springframework.mock.web.MockMultipartHttpServletRequest
- getMultipartContentType(String) - Method in class org.springframework.mock.web.MockMultipartHttpServletRequest
- getMultipartHeaders(String) - Method in class org.springframework.mock.web.MockMultipartHttpServletRequest
- getName() - Method in class org.springframework.mock.web.MockMultipartFile
- getName() - Method in class org.springframework.mock.web.MockPart
- getName() - Method in class org.springframework.mock.web.MockSessionCookieConfig
- getName() - Method in class org.springframework.test.context.ContextConfigurationAttributes
-
Get the name of the context hierarchy level that was declared via
@ContextConfiguration
. - getNamedDispatcher(String) - Method in class org.springframework.mock.web.MockServletContext
- getNativeRequest() - Method in class org.springframework.mock.http.client.reactive.MockClientHttpRequest
- getNativeRequest() - Method in class org.springframework.mock.http.server.reactive.MockServerHttpRequest
- getNativeResponse() - Method in class org.springframework.mock.http.server.reactive.MockServerHttpResponse
- getOrder() - Method in class org.springframework.test.context.event.ApplicationEventsTestExecutionListener
-
Returns
1800
. - getOrder() - Method in class org.springframework.test.context.event.EventPublishingTestExecutionListener
-
Returns
10000
. - getOrder() - Method in class org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener
-
Returns
5000
. - getOrder() - Method in class org.springframework.test.context.support.AbstractDirtiesContextTestExecutionListener
- getOrder() - Method in class org.springframework.test.context.support.AbstractTestExecutionListener
-
The default implementation returns
Ordered.LOWEST_PRECEDENCE
, thereby ensuring that custom listeners are ordered after default listeners supplied by the framework. - getOrder() - Method in class org.springframework.test.context.support.DependencyInjectionTestExecutionListener
-
Returns
2000
. - getOrder() - Method in class org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener
-
Returns
1500
. - getOrder() - Method in class org.springframework.test.context.support.DirtiesContextTestExecutionListener
-
Returns
3000
. - getOrder() - Method in class org.springframework.test.context.transaction.TransactionalTestExecutionListener
-
Returns
4000
. - getOrder() - Method in class org.springframework.test.context.web.ServletTestExecutionListener
-
Returns
1000
. - getOriginalFilename() - Method in class org.springframework.mock.web.MockMultipartFile
- getOut() - Method in class org.springframework.mock.web.MockPageContext
- getOutputStream() - Method in class org.springframework.mock.web.MockHttpServletResponse
- getPage() - Method in class org.springframework.mock.web.MockPageContext
- getParameter(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
- getParameterMap() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getParameterNames() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getParameterValues(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
- getParamsMultiValueMap(MockHttpServletRequest) - Method in class org.springframework.test.web.servlet.result.PrintingResultHandler
- getParent() - Method in class org.springframework.test.context.MergedContextConfiguration
-
Get the
MergedContextConfiguration
for the parent application context in a context hierarchy. - getParentApplicationContext() - Method in class org.springframework.test.context.MergedContextConfiguration
-
Get the parent
ApplicationContext
for the context defined by thisMergedContextConfiguration
from the context cache. - getParentContextCount() - Method in interface org.springframework.test.context.cache.ContextCache
-
Determine the number of parent contexts currently tracked within the cache.
- getParentContextCount() - Method in class org.springframework.test.context.cache.DefaultContextCache
- getPart(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
- getParts() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getPath() - Method in class org.springframework.mock.web.MockSessionCookieConfig
- getPathInfo() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getPathTranslated() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getPattern() - Method in class org.springframework.mock.web.MockHttpServletMapping
- getPrinter() - Method in class org.springframework.test.web.servlet.result.PrintingResultHandler
-
Return the result value printer.
- getPropertySourceDescriptors() - Method in class org.springframework.test.context.MergedContextConfiguration
-
Get the merged descriptors for resource locations for test
PropertySources
for the test class. - getPropertySourceLocations() - Method in class org.springframework.test.context.MergedContextConfiguration
-
Deprecated.since 6.1 in favor of
MergedContextConfiguration.getPropertySourceDescriptors()
- getPropertySourceProperties() - Method in class org.springframework.test.context.MergedContextConfiguration
-
Get the merged inlined properties for the test class.
- getProtocol() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getProtocolRequestId() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getQueryString() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getReader() - Method in class org.springframework.mock.web.MockBodyContent
- getReader() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getRealPath(String) - Method in class org.springframework.mock.web.MockServletContext
- getRedirectedUrl() - Method in class org.springframework.mock.web.MockHttpServletResponse
- getRemaining() - Method in class org.springframework.mock.web.MockBodyContent
- getRemaining() - Method in class org.springframework.mock.web.MockJspWriter
- getRemoteAddr() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getRemoteAddress() - Method in class org.springframework.mock.http.server.reactive.MockServerHttpRequest
- getRemoteHost() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getRemotePort() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getRemoteUser() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getRepeatCount(Method) - Static method in class org.springframework.test.annotation.TestAnnotationUtils
-
Get the repeat count configured via the
@Repeat
annotation on the suppliedmethod
. - getRequest() - Method in class org.springframework.mock.web.MockAsyncContext
- getRequest() - Method in class org.springframework.mock.web.MockFilterChain
-
Return the request that
MockFilterChain.doFilter(jakarta.servlet.ServletRequest, jakarta.servlet.ServletResponse)
has been called with. - getRequest() - Method in class org.springframework.mock.web.MockPageContext
- getRequest() - Method in interface org.springframework.test.web.servlet.MvcResult
-
Return the performed request.
- getRequestBodyContent() - Method in class org.springframework.test.web.reactive.server.ExchangeResult
-
Return the raw request body content written through the request.
- getRequestCharacterEncoding() - Method in class org.springframework.mock.web.MockServletContext
- getRequestCount() - Method in class org.springframework.test.web.client.DefaultRequestExpectation
- getRequestDetails() - Method in class org.springframework.test.web.client.AbstractRequestExpectationManager
-
Return details of executed requests.
- getRequestDispatcher(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
- getRequestDispatcher(String) - Method in class org.springframework.mock.web.MockServletContext
- getRequestedSessionId() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getRequestHeaders() - Method in class org.springframework.mock.web.MockMultipartHttpServletRequest
- getRequestHeaders() - Method in class org.springframework.test.web.reactive.server.ExchangeResult
-
Return the request headers sent to the server.
- getRequestHeaders(MockHttpServletRequest) - Method in class org.springframework.test.web.servlet.result.PrintingResultHandler
- getRequestId() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getRequestMatchers() - Method in class org.springframework.test.web.client.DefaultRequestExpectation
- getRequestMethod() - Method in class org.springframework.mock.web.MockMultipartHttpServletRequest
- getRequests() - Method in class org.springframework.test.web.client.AbstractRequestExpectationManager
-
Return a read-only list of requests executed so far.
- getRequestURI() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getRequestURL() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getRequiredApplicationEvents() - Static method in class org.springframework.test.context.event.ApplicationEventsHolder
-
Get the
ApplicationEvents
for the current thread. - getResolvedException() - Method in interface org.springframework.test.web.servlet.MvcResult
-
Return any exception raised by a handler and successfully resolved through a
HandlerExceptionResolver
. - getResource(String) - Method in class org.springframework.mock.web.MockServletContext
- getResourceAsStream(String) - Method in class org.springframework.mock.web.MockServletContext
- getResourceBasePath() - Method in class org.springframework.test.context.web.WebMergedContextConfiguration
-
Get the resource path to the root directory of the web application for the test class, configured via
@WebAppConfiguration
. - getResourceLocation(String) - Method in class org.springframework.mock.web.MockServletContext
-
Build a full resource location for the given path, prepending the resource base path of this
MockServletContext
. - getResourcePaths(String) - Method in class org.springframework.mock.web.MockServletContext
- getResourceSuffix() - Method in class org.springframework.test.context.support.AbstractContextLoader
-
Get the suffix to append to
ApplicationContext
resource locations when detecting default locations. - getResourceSuffix() - Method in class org.springframework.test.context.support.AnnotationConfigContextLoader
-
AnnotationConfigContextLoader
should be used as aSmartContextLoader
, not as a legacyContextLoader
. - getResourceSuffix() - Method in class org.springframework.test.context.support.GenericGroovyXmlContextLoader
-
GenericGroovyXmlContextLoader
supports both Groovy and XML resource types for detection of defaults. - getResourceSuffix() - Method in class org.springframework.test.context.support.GenericXmlContextLoader
-
Returns
"-context.xml"
in order to support detection of a default XML config file. - getResourceSuffix() - Method in class org.springframework.test.context.web.AnnotationConfigWebContextLoader
-
AnnotationConfigWebContextLoader
should be used as aSmartContextLoader
, not as a legacyContextLoader
. - getResourceSuffix() - Method in class org.springframework.test.context.web.GenericGroovyXmlWebContextLoader
-
GenericGroovyXmlWebContextLoader
supports both Groovy and XML resource types for detection of defaults. - getResourceSuffix() - Method in class org.springframework.test.context.web.GenericXmlWebContextLoader
-
Returns
"-context.xml"
in order to support detection of a default XML config file. - getResourceSuffixes() - Method in class org.springframework.test.context.support.AbstractContextLoader
-
Get the suffixes to append to
ApplicationContext
resource locations when detecting default locations. - getResourceSuffixes() - Method in class org.springframework.test.context.support.GenericGroovyXmlContextLoader
-
Returns
"-context.xml"
and"Context.groovy"
in order to support detection of a default XML config file or Groovy script. - getResourceSuffixes() - Method in class org.springframework.test.context.web.GenericGroovyXmlWebContextLoader
-
Returns
"-context.xml" and "Context.groovy"
in order to support detection of a default XML config file or Groovy script. - getResponse() - Method in class org.springframework.mock.web.MockAsyncContext
- getResponse() - Method in class org.springframework.mock.web.MockFilterChain
-
Return the response that
MockFilterChain.doFilter(jakarta.servlet.ServletRequest, jakarta.servlet.ServletResponse)
has been called with. - getResponse() - Method in class org.springframework.mock.web.MockPageContext
- getResponse() - Method in class org.springframework.mock.web.server.MockServerWebExchange
- getResponse() - Method in interface org.springframework.test.web.servlet.MvcResult
-
Return the resulting response.
- getResponse(WebRequest) - Method in class org.springframework.test.web.servlet.htmlunit.DelegatingWebConnection
- getResponse(WebRequest) - Method in class org.springframework.test.web.servlet.htmlunit.MockMvcWebConnection
- getResponseBody() - Method in class org.springframework.test.web.reactive.server.EntityExchangeResult
-
Return the entity extracted from the response body.
- getResponseBody() - Method in class org.springframework.test.web.reactive.server.FluxExchangeResult
-
Return the response body as a
Flux<T>
of decoded elements. - getResponseBodyContent() - Method in class org.springframework.test.web.reactive.server.ExchangeResult
-
Return the raw request body content written to the response.
- getResponseCharacterEncoding() - Method in class org.springframework.mock.web.MockServletContext
- getResponseCookies() - Method in class org.springframework.test.web.reactive.server.ExchangeResult
-
Return response cookies received from the server.
- getResponseCreator() - Method in class org.springframework.test.web.client.DefaultRequestExpectation
- getResponseHeaders() - Method in class org.springframework.test.web.reactive.server.ExchangeResult
-
Return the response headers received from the server.
- getResponseHeaders(MockHttpServletResponse) - Method in class org.springframework.test.web.servlet.result.PrintingResultHandler
- getRootDeclaringClass() - Method in class org.springframework.test.context.TestContextAnnotationUtils.AnnotationDescriptor
- getRuntimeHints() - Method in class org.springframework.test.context.aot.TestContextAotGenerator
-
Get the
RuntimeHints
gathered during AOT processing. - getSameSite() - Method in class org.springframework.mock.web.MockCookie
-
Get the "SameSite" attribute for this cookie.
- getScheme() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getServerInfo() - Method in class org.springframework.mock.web.MockServletContext
- getServerName() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getServerPort() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getServerResult() - Method in interface org.springframework.test.web.reactive.server.MockServerClientHttpResponse
-
Return the result object with the server request and response.
- getServletConfig() - Method in class org.springframework.mock.web.MockPageContext
- getServletConnection() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getServletContext() - Method in class org.springframework.mock.web.MockFilterConfig
- getServletContext() - Method in class org.springframework.mock.web.MockHttpServletRequest
-
Return the ServletContext that this request is associated with.
- getServletContext() - Method in class org.springframework.mock.web.MockHttpSession
- getServletContext() - Method in class org.springframework.mock.web.MockPageContext
- getServletContext() - Method in class org.springframework.mock.web.MockServletConfig
- getServletContextName() - Method in class org.springframework.mock.web.MockServletContext
- getServletName() - Method in class org.springframework.mock.web.MockHttpServletMapping
- getServletName() - Method in class org.springframework.mock.web.MockServletConfig
- getServletPath() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getServletRegistration(String) - Method in class org.springframework.mock.web.MockServletContext
-
This method always returns
null
. - getServletRegistrations() - Method in class org.springframework.mock.web.MockServletContext
-
This method always returns an empty map.
- getSession() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getSession() - Method in class org.springframework.mock.web.MockPageContext
- getSession(boolean) - Method in class org.springframework.mock.web.MockHttpServletRequest
- getSessionAttributes(MockHttpServletRequest) - Method in class org.springframework.test.web.servlet.result.PrintingResultHandler
- getSessionCookieConfig() - Method in class org.springframework.mock.web.MockServletContext
- getSessionTimeout() - Method in class org.springframework.mock.web.MockServletContext
- getSize() - Method in class org.springframework.mock.web.MockMultipartFile
- getSize() - Method in class org.springframework.mock.web.MockPart
- getSource() - Method in class org.springframework.test.context.event.TestContextEvent
-
Get the
TestContext
associated with this event. - getSourceStream() - Method in class org.springframework.mock.web.DelegatingServletInputStream
-
Return the underlying source stream (never
null
). - getSpringTimeout(FrameworkMethod) - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
-
Retrieve the configured Spring-specific
timeout
from the@Timed
annotation on the supplied test method. - getStatus() - Method in class org.springframework.mock.web.MockHttpServletResponse
- getStatus() - Method in class org.springframework.test.web.reactive.server.ExchangeResult
-
Return the HTTP status code as an
HttpStatusCode
value. - getStatusCode() - Method in class org.springframework.mock.http.client.MockClientHttpResponse
- getStatusCode() - Method in class org.springframework.mock.http.client.reactive.MockClientHttpResponse
- getStatusText() - Method in class org.springframework.mock.http.client.MockClientHttpResponse
- getString() - Method in class org.springframework.mock.web.MockBodyContent
- getString(String) - Method in interface org.springframework.test.context.aot.AotTestAttributes
-
Retrieve the attribute value for the given name as a
String
. - getSubmittedFileName() - Method in class org.springframework.mock.web.MockPart
- getTargetObject(Object) - Static method in class org.springframework.test.util.AopTestUtils
-
Get the target object of the supplied
candidate
object. - getTargetStream() - Method in class org.springframework.mock.web.DelegatingServletOutputStream
-
Return the underlying target stream (never
null
). - getTargetWriter() - Method in class org.springframework.mock.web.MockJspWriter
-
Lazily initialize the target Writer.
- getTestClass() - Method in interface org.springframework.test.context.BootstrapContext
-
Get the test class for this bootstrap context.
- getTestClass() - Method in class org.springframework.test.context.MergedContextConfiguration
-
Get the test class associated with this
MergedContextConfiguration
. - getTestClass() - Method in class org.springframework.test.context.support.DefaultBootstrapContext
- getTestClass() - Method in class org.springframework.test.context.support.DefaultTestContext
- getTestClass() - Method in interface org.springframework.test.context.TestContext
-
Get the test class for this test context.
- getTestContext() - Method in class org.springframework.test.context.event.TestContextEvent
-
Alias for
TestContextEvent.getSource()
. - getTestContext() - Method in class org.springframework.test.context.TestContextManager
-
Get the
TestContext
managed by thisTestContextManager
. - getTestContextManager() - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
-
Get the
TestContextManager
associated with this runner. - getTestException() - Method in class org.springframework.test.context.support.DefaultTestContext
- getTestException() - Method in interface org.springframework.test.context.TestContext
-
Get the exception that was thrown during execution of the test method.
- getTestExecutionListeners() - Method in class org.springframework.test.context.support.AbstractTestContextBootstrapper
- getTestExecutionListeners() - Method in interface org.springframework.test.context.TestContextBootstrapper
-
Get a list of newly instantiated
TestExecutionListeners
for the test class in theBootstrapContext
associated with this bootstrapper. - getTestExecutionListeners() - Method in class org.springframework.test.context.TestContextManager
-
Get the current
TestExecutionListeners
registered for thisTestContextManager
. - getTestInstance() - Method in class org.springframework.test.context.support.DefaultTestContext
- getTestInstance() - Method in interface org.springframework.test.context.TestContext
-
Get the current test instance for this test context.
- getTestMethod() - Method in class org.springframework.test.context.support.DefaultTestContext
- getTestMethod() - Method in interface org.springframework.test.context.TestContext
-
Get the current test method for this test context.
- getTimeout() - Method in class org.springframework.mock.web.MockAsyncContext
- getTimeout(Method) - Static method in class org.springframework.test.annotation.TestAnnotationUtils
- getTransactionManager(TestContext) - Method in class org.springframework.test.context.transaction.TransactionalTestExecutionListener
-
Get the transaction manager to use for the supplied test context.
- getTransactionManager(TestContext, String) - Method in class org.springframework.test.context.transaction.TransactionalTestExecutionListener
-
Get the transaction manager to use for the supplied test context and
qualifier
. - getUltimateTargetObject(Object) - Static method in class org.springframework.test.util.AopTestUtils
-
Get the ultimate target object of the supplied
candidate
object, unwrapping not only a top-level proxy but also any number of nested proxies. - getURI() - Method in class org.springframework.mock.http.client.MockClientHttpRequest
- getURI() - Method in class org.springframework.mock.http.client.reactive.MockClientHttpRequest
- getUriTemplate() - Method in class org.springframework.test.web.reactive.server.ExchangeResult
-
Return the original URI template used to prepare the request, if any.
- getUrl() - Method in class org.springframework.test.web.reactive.server.ExchangeResult
-
Return the URI of the request.
- getUserPrincipal() - Method in class org.springframework.mock.web.MockHttpServletRequest
- getVariableResolver() - Method in class org.springframework.mock.web.MockPageContext
-
Deprecated.
- getVirtualServerName() - Method in class org.springframework.mock.web.MockServletContext
- getWebClient() - Method in class org.springframework.test.web.servlet.htmlunit.webdriver.WebConnectionHtmlUnitDriver
-
Return the current
WebClient
in a public fashion. - getWebConnection() - Method in class org.springframework.test.web.servlet.htmlunit.webdriver.WebConnectionHtmlUnitDriver
-
Access the current
WebConnection
for theWebClient
. - getWriter() - Method in class org.springframework.mock.web.MockHttpServletResponse
- getXmlLoader() - Method in class org.springframework.test.context.support.AbstractDelegatingSmartContextLoader
-
Get the delegate
SmartContextLoader
that supports XML configuration files and/or Groovy scripts. - getXmlLoader() - Method in class org.springframework.test.context.support.DelegatingSmartContextLoader
- getXmlLoader() - Method in class org.springframework.test.context.web.WebDelegatingSmartContextLoader
- getXpathExpression() - Method in class org.springframework.test.util.XpathExpectationsHelper
-
Return the compiled XPath expression.
H
- handle(MvcResult) - Method in class org.springframework.test.web.servlet.result.PrintingResultHandler
-
Print
MvcResult
details. - handle(MvcResult) - Method in interface org.springframework.test.web.servlet.ResultHandler
-
Perform an action on the given result.
- handlePageException(Exception) - Method in class org.springframework.mock.web.MockPageContext
- handlePageException(Throwable) - Method in class org.springframework.mock.web.MockPageContext
- handler() - Static method in class org.springframework.test.web.servlet.result.MockMvcResultMatchers
-
Access to assertions for the handler that handled the request.
- handlerExceptionResolvers(HandlerExceptionResolver...) - Method in interface org.springframework.test.web.servlet.client.MockMvcWebTestClient.ControllerSpec
-
Set the HandlerExceptionResolver types to use.
- HandlerResultMatchers - Class in org.springframework.test.web.servlet.result
-
Factory for assertions on the selected handler or handler method.
- HandlerResultMatchers() - Constructor for class org.springframework.test.web.servlet.result.HandlerResultMatchers
-
Protected constructor.
- handlerStrategies(HandlerStrategies) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.RouterFunctionSpec
-
Configure handler strategies.
- handlerType(Class<?>) - Method in class org.springframework.test.web.servlet.result.HandlerResultMatchers
-
Assert the type of the handler that processed the request.
- hasAnnotation(Class<?>, Class<? extends Annotation>) - Static method in class org.springframework.test.context.TestContextAnnotationUtils
-
Determine if an annotation of the specified
annotationType
is present or meta-present on the suppliedClass
according to the search algorithm used inTestContextAnnotationUtils.findMergedAnnotation(Class, Class)
. - hasApplicationContext() - Method in class org.springframework.test.context.support.DefaultTestContext
-
Determine if the application context for this test context is present in the context cache.
- hasApplicationContext() - Method in interface org.springframework.test.context.TestContext
-
Determine if the application context for this test context is known to be available.
- hasAttribute(String) - Method in class org.springframework.test.context.support.DefaultTestContext
- hasClasses() - Method in class org.springframework.test.context.ContextConfigurationAttributes
-
Determine if this
ContextConfigurationAttributes
instance has class-based resources. - hasClasses() - Method in class org.springframework.test.context.MergedContextConfiguration
-
Determine if this
MergedContextConfiguration
instance has class-based resources. - hasErrors() - Method in class org.springframework.test.web.servlet.result.ModelResultMatchers
-
Assert the model has errors.
- hashCode() - Method in class org.springframework.test.context.ContextConfigurationAttributes
-
Generate a unique hash code for all properties of this
ContextConfigurationAttributes
instance excluding the name. - hashCode() - Method in class org.springframework.test.context.MergedContextConfiguration
-
Generate a unique hash code for all properties of this
MergedContextConfiguration
excluding the test class. - hashCode() - Method in class org.springframework.test.context.web.WebMergedContextConfiguration
-
Generate a unique hash code for all properties of this
WebMergedContextConfiguration
excluding the test class. - hashCode() - Method in class org.springframework.test.web.reactive.server.JsonPathAssertions
- hashCode() - Method in class org.springframework.test.web.reactive.server.XpathAssertions
- hasJsonPath() - Method in class org.springframework.test.web.client.match.JsonPathRequestMatchers
-
Evaluate the JSON path expression against the response content and assert that a value, possibly
null
, exists. - hasJsonPath() - Method in class org.springframework.test.web.reactive.server.JsonPathAssertions
- hasJsonPath() - Method in class org.springframework.test.web.servlet.result.JsonPathResultMatchers
-
Evaluate the JSON path expression against the response content and assert that a value, possibly
null
, exists. - hasJsonPath(String) - Method in class org.springframework.test.util.JsonPathExpectationsHelper
-
Evaluate the JSON path expression against the supplied
content
and assert that a value, possiblynull
, exists. - hasLocations() - Method in class org.springframework.test.context.ContextConfigurationAttributes
-
Determine if this
ContextConfigurationAttributes
instance has path-based resource locations. - hasLocations() - Method in class org.springframework.test.context.MergedContextConfiguration
-
Determine if this
MergedContextConfiguration
instance has path-based context resource locations. - hasNoErrors() - Method in class org.springframework.test.web.servlet.result.ModelResultMatchers
-
Assert the model has no errors.
- hasOriginalRequestAndResponse() - Method in class org.springframework.mock.web.MockAsyncContext
- hasRemainingCount() - Method in class org.springframework.test.web.client.DefaultRequestExpectation
- hasRemainingCount() - Method in class org.springframework.test.web.client.DefaultRequestExpectation.RequestCount
- hasRemainingCount() - Method in interface org.springframework.test.web.client.RequestExpectation
-
Whether there is a remaining count of invocations for this expectation.
- hasResources() - Method in class org.springframework.test.context.ContextConfigurationAttributes
-
Determine if this
ContextConfigurationAttributes
instance has either path-based resource locations or class-based resources. - hasResources() - Method in class org.springframework.test.context.MergedContextConfiguration
-
Determine if this
MergedContextConfiguration
instance has either path-based context resource locations or class-based resources. - hasSize(int) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.ListBodySpec
-
Assert the extracted list of values is of the given size.
- head() - Method in interface org.springframework.test.web.reactive.server.WebTestClient
-
Prepare an HTTP HEAD request.
- head(String, Object...) - Static method in class org.springframework.mock.http.server.reactive.MockServerHttpRequest
-
HTTP HEAD variant.
- head(String, Object...) - Static method in class org.springframework.test.web.servlet.request.MockMvcRequestBuilders
-
Create a
MockHttpServletRequestBuilder
for a HEAD request. - head(URI) - Static method in class org.springframework.test.web.servlet.request.MockMvcRequestBuilders
-
Create a
MockHttpServletRequestBuilder
for a HEAD request. - header() - Static method in class org.springframework.test.web.servlet.result.MockMvcResultMatchers
-
Access to response header assertions.
- header(String, Object...) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Add a header to the request.
- header(String, String) - Method in interface org.springframework.mock.web.reactive.function.server.MockServerRequest.Builder
- header(String, String...) - Method in interface org.springframework.mock.http.server.reactive.MockServerHttpRequest.BaseBuilder
-
Add the given, single header value under the given name.
- header(String, String...) - Static method in class org.springframework.test.web.client.match.MockRestRequestMatchers
-
Assert request header values.
- header(String, String...) - Method in class org.springframework.test.web.client.response.DefaultResponseCreator
-
Add a response header with one or more values.
- header(String, String...) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.RequestHeadersSpec
-
Add the given, single header value under the given name.
- header(String, Matcher<? super String>...) - Static method in class org.springframework.test.web.client.match.MockRestRequestMatchers
-
Assert request header values with the given Hamcrest matcher(s).
- HeaderAssertions - Class in org.springframework.test.web.reactive.server
-
Assertions on headers of the response.
- headerDoesNotExist(String) - Static method in class org.springframework.test.web.client.match.MockRestRequestMatchers
-
Assert that the given request header does not exist.
- headerList(String, Matcher<? super List<String>>) - Static method in class org.springframework.test.web.client.match.MockRestRequestMatchers
-
Assert request header values with the given Hamcrest matcher, matching on the entire
List
of values. - HeaderResultMatchers - Class in org.springframework.test.web.servlet.result
-
Factory for response header assertions.
- HeaderResultMatchers() - Constructor for class org.springframework.test.web.servlet.result.HeaderResultMatchers
-
Protected constructor.
- headers() - Method in class org.springframework.mock.web.reactive.function.server.MockServerRequest
- headers(Consumer<HttpHeaders>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.RequestHeadersSpec
-
Manipulate the request's headers with the given consumer.
- headers(HttpHeaders) - Method in interface org.springframework.mock.web.reactive.function.server.MockServerRequest.Builder
- headers(HttpHeaders) - Method in class org.springframework.test.web.client.response.DefaultResponseCreator
-
Copy all given headers.
- headers(HttpHeaders) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Add all headers to the request.
- headers(MultiValueMap<String, String>) - Method in interface org.springframework.mock.http.server.reactive.MockServerHttpRequest.BaseBuilder
-
Add the given header values.
- hierarchyMode() - Element in annotation interface org.springframework.test.annotation.DirtiesContext
-
The context cache clearing mode to use when a context is configured as part of a hierarchy via
@ContextHierarchy
. - HostRequestMatcher - Class in org.springframework.test.web.servlet.htmlunit
-
A
WebRequestMatcher
that allows matching on the host and optionally the port ofWebRequest#getUrl()
. - HostRequestMatcher(String...) - Constructor for class org.springframework.test.web.servlet.htmlunit.HostRequestMatcher
-
Create a new
HostRequestMatcher
for the given hosts — for example:"localhost"
,"example.com:443"
, etc. - HttpHandlerConnector - Class in org.springframework.test.web.reactive.server
-
Connector that handles requests by invoking an
HttpHandler
rather than making actual requests to a network socket. - HttpHandlerConnector(HttpHandler) - Constructor for class org.springframework.test.web.reactive.server.HttpHandlerConnector
-
Constructor with the
HttpHandler
to handle requests with. - HttpHandlerConnector.FailureAfterResponseCompletedException - Exception in org.springframework.test.web.reactive.server
-
Indicates that an error occurred after the server response was completed, via
ReactiveHttpOutputMessage.writeWith(org.reactivestreams.Publisher<? extends org.springframework.core.io.buffer.DataBuffer>)
orReactiveHttpOutputMessage.setComplete()
, and can no longer be changed. - httpMessageCodecs(Consumer<ServerCodecConfigurer>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.ControllerSpec
-
Configure custom HTTP message readers and writers or override built-in ones.
- httpOnly(String, boolean) - Method in class org.springframework.test.web.reactive.server.CookieAssertions
-
Assert a cookie's httpOnly attribute.
- httpOnly(String, boolean) - Method in class org.springframework.test.web.servlet.result.CookieResultMatchers
-
Assert whether the cookie must be HTTP only.
I
- ifModifiedSince(long) - Method in interface org.springframework.mock.http.server.reactive.MockServerHttpRequest.BaseBuilder
-
Set the value of the
If-Modified-Since
header. - ifModifiedSince(ZonedDateTime) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.RequestHeadersSpec
-
Set the value of the
If-Modified-Since
header. - ifNoneMatch(String...) - Method in interface org.springframework.mock.http.server.reactive.MockServerHttpRequest.BaseBuilder
-
Set the values of the
If-None-Match
header. - ifNoneMatch(String...) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.RequestHeadersSpec
-
Set the values of the
If-None-Match
header. - IfProfileValue - Annotation Interface in org.springframework.test.annotation
-
Test annotation for use with JUnit 4 to indicate whether a test is enabled or disabled for a specific testing profile.
- ifUnmodifiedSince(long) - Method in interface org.springframework.mock.http.server.reactive.MockServerHttpRequest.BaseBuilder
-
Set the (new) value of the
If-Unmodified-Since
header. - IGNORE_FAILED_DROPS - Enum constant in enum class org.springframework.test.context.jdbc.SqlConfig.ErrorMode
-
Indicates that failed SQL
DROP
statements can be ignored. - ignoreExpectOrder(boolean) - Method in interface org.springframework.test.web.client.MockRestServiceServer.MockRestServiceServerBuilder
-
Whether to allow expected requests to be executed in any order not necessarily matching the order of declaration.
- include(ServletRequest, ServletResponse) - Method in class org.springframework.mock.web.MockRequestDispatcher
- include(String) - Method in class org.springframework.mock.web.MockPageContext
- include(String, boolean) - Method in class org.springframework.mock.web.MockPageContext
- incrementAndValidate() - Method in class org.springframework.test.web.client.DefaultRequestExpectation
- incrementAndValidate() - Method in class org.springframework.test.web.client.DefaultRequestExpectation.RequestCount
- incrementAndValidate() - Method in interface org.springframework.test.web.client.RequestExpectation
-
Increase the matched request count and check we haven't passed the max count.
- incrementFailureCount(MergedContextConfiguration) - Method in interface org.springframework.test.context.cache.ContextCache
-
Increment the failure count for the given key.
- incrementFailureCount(MergedContextConfiguration) - Method in class org.springframework.test.context.cache.DefaultContextCache
- INFERRED - Enum constant in enum class org.springframework.test.context.jdbc.SqlConfig.TransactionMode
-
Indicates that the transaction mode to use when executing SQL scripts should be inferred using the rules listed below.
- INHERIT - Enum constant in enum class org.springframework.test.context.NestedTestConfiguration.EnclosingConfiguration
-
Indicates that test configuration for an inner test class should be inherited from its enclosing class, as if the enclosing class were a superclass.
- inheritFactories() - Element in annotation interface org.springframework.test.context.ContextCustomizerFactories
-
Whether the configured set of
ContextCustomizerFactories.factories()
from superclasses and enclosing classes should be inherited. - inheritInitializers() - Element in annotation interface org.springframework.test.context.ContextConfiguration
-
Whether context initializers from test superclasses and enclosing classes should be inherited.
- inheritInitializers() - Element in annotation interface org.springframework.test.context.junit.jupiter.SpringJUnitConfig
-
Alias for
ContextConfiguration.inheritInitializers()
. - inheritInitializers() - Element in annotation interface org.springframework.test.context.junit.jupiter.web.SpringJUnitWebConfig
-
Alias for
ContextConfiguration.inheritInitializers()
. - inheritListeners() - Element in annotation interface org.springframework.test.context.TestExecutionListeners
-
Whether
TestExecutionListeners
from superclasses and enclosing classes should be inherited. - inheritLocations() - Element in annotation interface org.springframework.test.context.ContextConfiguration
-
Whether resource locations or component classes from test superclasses and enclosing classes should be inherited.
- inheritLocations() - Element in annotation interface org.springframework.test.context.junit.jupiter.SpringJUnitConfig
-
Alias for
ContextConfiguration.inheritLocations()
. - inheritLocations() - Element in annotation interface org.springframework.test.context.junit.jupiter.web.SpringJUnitWebConfig
-
Alias for
ContextConfiguration.inheritLocations()
. - inheritLocations() - Element in annotation interface org.springframework.test.context.TestPropertySource
-
Whether test property source
TestPropertySource.locations()
from superclasses and enclosing classes should be inherited. - inheritProfiles() - Element in annotation interface org.springframework.test.context.ActiveProfiles
-
Whether bean definition profiles from superclasses and enclosing classes should be inherited.
- inheritProperties() - Element in annotation interface org.springframework.test.context.TestPropertySource
-
Whether inlined test
TestPropertySource.properties()
from superclasses and enclosing classes should be inherited. - initCookies() - Method in class org.springframework.mock.http.server.reactive.MockServerHttpRequest
- initialize(Servlet, ServletRequest, ServletResponse, String, boolean, int, boolean) - Method in class org.springframework.mock.web.MockPageContext
- initializers() - Element in annotation interface org.springframework.test.context.ContextConfiguration
-
The application context initializer classes to use for initializing a
ConfigurableApplicationContext
. - initializers() - Element in annotation interface org.springframework.test.context.junit.jupiter.SpringJUnitConfig
-
Alias for
ContextConfiguration.initializers()
. - initializers() - Element in annotation interface org.springframework.test.context.junit.jupiter.web.SpringJUnitWebConfig
-
Alias for
ContextConfiguration.initializers()
. - initSslInfo() - Method in class org.springframework.mock.http.server.reactive.MockServerHttpRequest
- initWebAppContext() - Method in class org.springframework.test.web.servlet.setup.AbstractMockMvcBuilder
-
A method to obtain the
WebApplicationContext
to be passed to theDispatcherServlet
. - initWebAppContext() - Method in class org.springframework.test.web.servlet.setup.DefaultMockMvcBuilder
- initWebAppContext() - Method in class org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder
- injectDependencies(TestContext) - Method in class org.springframework.test.context.support.DependencyInjectionTestExecutionListener
-
Performs dependency injection and bean initialization for the supplied
TestContext
as described inprepareTestInstance()
. - INLINED_PROPERTIES_PROPERTY_SOURCE_NAME - Static variable in class org.springframework.test.context.support.TestPropertySourceUtils
-
The name of the
MapPropertySource
created from inlined properties. - interceptors(HandlerInterceptor...) - Method in interface org.springframework.test.web.servlet.client.MockMvcWebTestClient.ControllerSpec
-
Add global interceptors.
- invalidate() - Method in class org.springframework.mock.web.MockHttpServletRequest
-
Invalidate this request, clearing its state.
- invalidate() - Method in class org.springframework.mock.web.MockHttpSession
-
Invalidates this session then unbinds any objects bound to it.
- invalidate() - Method in class org.springframework.mock.web.server.MockWebSession
- invoke(Method, Object) - Method in interface org.springframework.test.context.MethodInvoker
-
Invoke the supplied
Method
on the suppliedtarget
. - invokeGetterMethod(Object, String) - Static method in class org.springframework.test.util.ReflectionTestUtils
-
Invoke the getter method with the given
name
on the supplied target object with the suppliedvalue
. - invokeMethod(Class<?>, String, Object...) - Static method in class org.springframework.test.util.ReflectionTestUtils
-
Invoke the static method with the given
name
on the supplied target class with the supplied arguments. - invokeMethod(Object, Class<?>, String, Object...) - Static method in class org.springframework.test.util.ReflectionTestUtils
-
Invoke the method with the given
name
on the providedtargetObject
/targetClass
with the supplied arguments. - invokeMethod(Object, String, Object...) - Static method in class org.springframework.test.util.ReflectionTestUtils
-
Invoke the method with the given
name
on the supplied target object with the supplied arguments. - invokeSetterMethod(Object, String, Object) - Static method in class org.springframework.test.util.ReflectionTestUtils
-
Invoke the setter method with the given
name
on the supplied target object with the suppliedvalue
. - invokeSetterMethod(Object, String, Object, Class<?>) - Static method in class org.springframework.test.util.ReflectionTestUtils
-
Invoke the setter method with the given
name
on the supplied target object with the suppliedvalue
. - is(int) - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is equal to an integer value.
- is(Matcher<? super Integer>) - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code with the given Hamcrest
Matcher
. - is1xxInformational() - Method in class org.springframework.test.web.reactive.server.StatusAssertions
-
Assert the response status code is in the 1xx range.
- is1xxInformational() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is in the 1xx range.
- is2xxSuccessful() - Method in class org.springframework.test.web.reactive.server.StatusAssertions
-
Assert the response status code is in the 2xx range.
- is2xxSuccessful() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is in the 2xx range.
- is3xxRedirection() - Method in class org.springframework.test.web.reactive.server.StatusAssertions
-
Assert the response status code is in the 3xx range.
- is3xxRedirection() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is in the 3xx range.
- is4xxClientError() - Method in class org.springframework.test.web.reactive.server.StatusAssertions
-
Assert the response status code is in the 4xx range.
- is4xxClientError() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is in the 4xx range.
- is5xxServerError() - Method in class org.springframework.test.web.reactive.server.StatusAssertions
-
Assert the response status code is in the 5xx range.
- is5xxServerError() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is in the 5xx range.
- isAccepted() - Method in class org.springframework.test.web.reactive.server.StatusAssertions
-
Assert the response status code is
HttpStatus.ACCEPTED
(202). - isAccepted() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.ACCEPTED
(202). - isActive() - Method in class org.springframework.mock.web.MockHttpServletRequest
-
Return whether this request is still active (that is, not completed yet).
- isActive() - Static method in class org.springframework.test.context.transaction.TestTransaction
-
Determine whether a test-managed transaction is currently active.
- isAlreadyReported() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.ALREADY_REPORTED
(208). - isArray() - Method in class org.springframework.test.web.client.match.JsonPathRequestMatchers
-
Evaluate the JSON path expression against the request content and assert that the result is an array.
- isArray() - Method in class org.springframework.test.web.reactive.server.JsonPathAssertions
- isArray() - Method in class org.springframework.test.web.servlet.result.JsonPathResultMatchers
-
Evaluate the JSON path expression against the response content and assert that the result is an array.
- isAsyncStarted() - Method in class org.springframework.mock.web.MockHttpServletRequest
- isAsyncSupported() - Method in class org.springframework.mock.web.MockHttpServletRequest
- isAutowirableConstructor(Constructor<?>, Class<?>) - Static method in class org.springframework.test.context.support.TestConstructorUtils
-
Determine if the supplied constructor for the given test class is autowirable.
- isAutowirableConstructor(Constructor<?>, Class<?>, PropertyProvider) - Static method in class org.springframework.test.context.support.TestConstructorUtils
-
Determine if the supplied constructor for the given test class is autowirable.
- isAutowirableConstructor(Executable, Class<?>) - Static method in class org.springframework.test.context.support.TestConstructorUtils
-
Determine if the supplied executable for the given test class is an autowirable constructor.
- isAutowirableConstructor(Executable, Class<?>, PropertyProvider) - Static method in class org.springframework.test.context.support.TestConstructorUtils
-
Determine if the supplied executable for the given test class is an autowirable constructor.
- isBadGateway() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.BAD_GATEWAY
(502). - isBadRequest() - Method in class org.springframework.test.web.reactive.server.StatusAssertions
-
Assert the response status code is
HttpStatus.BAD_REQUEST
(400). - isBadRequest() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.BAD_REQUEST
(400). - isBandwidthLimitExceeded() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.BANDWIDTH_LIMIT_EXCEEDED
(509). - isBoolean() - Method in class org.springframework.test.web.client.match.JsonPathRequestMatchers
-
Evaluate the JSON path expression against the request content and assert that the result is a
Boolean
. - isBoolean() - Method in class org.springframework.test.web.reactive.server.JsonPathAssertions
- isBoolean() - Method in class org.springframework.test.web.servlet.result.JsonPathResultMatchers
-
Evaluate the JSON path expression against the response content and assert that the result is a
Boolean
. - isCharset() - Method in class org.springframework.mock.web.MockHttpServletResponse
-
Determine whether the character encoding has been explicitly set through
HttpServletResponse
methods or through acharset
parameter on theContent-Type
. - isCheckpoint() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Deprecated.in favor of
StatusResultMatchers.isEarlyHints()
- isCommitted() - Method in class org.springframework.mock.web.MockHttpServletResponse
- isConflict() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.CONFLICT
(409). - isContextLoaded(MergedContextConfiguration) - Method in class org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate
- isContextLoaded(MergedContextConfiguration) - Method in interface org.springframework.test.context.CacheAwareContextLoaderDelegate
-
Determine if the application context for the supplied
MergedContextConfiguration
has been loaded (i.e., is present in theContextCache
). - isContinue() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.CONTINUE
(100). - isCreated() - Method in class org.springframework.test.web.reactive.server.StatusAssertions
-
Assert the response status code is
HttpStatus.CREATED
(201). - isCreated() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.CREATED
(201). - isDefaultRollback(TestContext) - Method in class org.springframework.test.context.transaction.TransactionalTestExecutionListener
-
Determine whether to rollback transactions by default for the supplied test context.
- isDestinationLocked() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Deprecated.matching the deprecation of
HttpStatus.DESTINATION_LOCKED
- isEarlyHints() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.EARLY_HINTS
(103). - isEmpty() - Method in class org.springframework.mock.web.MockMultipartFile
- isEmpty() - Method in class org.springframework.test.web.client.match.JsonPathRequestMatchers
-
Evaluate the JSON path expression against the request content and assert that an empty value exists at the given path.
- isEmpty() - Method in class org.springframework.test.web.reactive.server.JsonPathAssertions
- isEmpty() - Method in interface org.springframework.test.web.reactive.server.WebTestClient.BodyContentSpec
-
Assert the response body is empty and return the exchange result.
- isEmpty() - Method in class org.springframework.test.web.servlet.result.JsonPathResultMatchers
-
Evaluate the JSON path expression against the response content and assert that an empty value exists at the given path.
- isEqualTo(boolean) - Method in class org.springframework.test.web.reactive.server.XpathAssertions
- isEqualTo(int) - Method in class org.springframework.test.web.reactive.server.StatusAssertions
-
Assert the response status as an integer.
- isEqualTo(B) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.BodySpec
-
Assert the extracted body is equal to the given value.
- isEqualTo(Double) - Method in class org.springframework.test.web.reactive.server.XpathAssertions
- isEqualTo(Object) - Method in class org.springframework.test.web.reactive.server.JsonPathAssertions
- isEqualTo(String) - Method in class org.springframework.test.web.reactive.server.XpathAssertions
- isEqualTo(HttpStatusCode) - Method in class org.springframework.test.web.reactive.server.StatusAssertions
-
Assert the response status as an
HttpStatusCode
. - isExecuted() - Method in class org.springframework.mock.http.client.MockClientHttpRequest
-
Get the
executed
flag. - isExpectationFailed() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.EXPECTATION_FAILED
(417). - isExpired() - Method in class org.springframework.mock.web.server.MockWebSession
- isFailedDependency() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.FAILED_DEPENDENCY
(424). - isFinished() - Method in class org.springframework.mock.web.DelegatingServletInputStream
- isFlaggedForRollback() - Static method in class org.springframework.test.context.transaction.TestTransaction
-
Determine whether the current test-managed transaction has been flagged for rollback or flagged for commit.
- isForbidden() - Method in class org.springframework.test.web.reactive.server.StatusAssertions
-
Assert the response status code is
HttpStatus.FORBIDDEN
(403). - isForbidden() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.FORBIDDEN
(403). - isFound() - Method in class org.springframework.test.web.reactive.server.StatusAssertions
-
Assert the response status code is
HttpStatus.FOUND
(302). - isFound() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.FOUND
(302). - isGatewayTimeout() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.GATEWAY_TIMEOUT
(504). - isGenerateDefaultLocations() - Method in class org.springframework.test.context.support.AbstractContextLoader
-
Determine whether default resource locations should be generated if the
locations
provided toAbstractContextLoader.processLocations(Class, String...)
arenull
or empty. - isGone() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.GONE
(410). - isHttpOnly() - Method in class org.springframework.mock.web.MockSessionCookieConfig
- isHttpVersionNotSupported() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.HTTP_VERSION_NOT_SUPPORTED
(505). - isIAmATeapot() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.I_AM_A_TEAPOT
(418). - isImUsed() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.IM_USED
(226). - isInheritInitializers() - Method in class org.springframework.test.context.ContextConfigurationAttributes
-
Get the
inheritInitializers
flag that was declared via@ContextConfiguration
. - isInheritLocations() - Method in class org.springframework.test.context.ContextConfigurationAttributes
-
Get the
inheritLocations
flag that was declared via@ContextConfiguration
. - isInsufficientSpaceOnResource() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Deprecated.matching the deprecation of
HttpStatus.INSUFFICIENT_SPACE_ON_RESOURCE
- isInsufficientStorage() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.INSUFFICIENT_STORAGE
(507). - isInternalServerError() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.INTERNAL_SERVER_ERROR
(500). - isInvalid() - Method in class org.springframework.mock.web.MockHttpSession
- isLengthRequired() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.LENGTH_REQUIRED
(411). - isLocked() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.LOCKED
(423). - isLoopDetected() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.LOOP_DETECTED
(508). - isMap() - Method in class org.springframework.test.web.client.match.JsonPathRequestMatchers
-
Evaluate the JSON path expression against the request content and assert that the result is a
Map
. - isMap() - Method in class org.springframework.test.web.reactive.server.JsonPathAssertions
- isMap() - Method in class org.springframework.test.web.servlet.result.JsonPathResultMatchers
-
Evaluate the JSON path expression against the response content and assert that the result is a
Map
. - isMergeEnabled() - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
- isMethodFailure() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Deprecated.matching the deprecation of
HttpStatus.METHOD_FAILURE
- isMethodNotAllowed() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.METHOD_NOT_ALLOWED
(405). - isMovedPermanently() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.MOVED_PERMANENTLY
(301). - isMovedTemporarily() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Deprecated.in favor of
StatusResultMatchers.isFound()
- isMultipleChoices() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.MULTIPLE_CHOICES
(300). - isMultiStatus() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.MULTI_STATUS
(207). - isNetworkAuthenticationRequired() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.NETWORK_AUTHENTICATION_REQUIRED
(511). - isNew() - Method in class org.springframework.mock.web.MockHttpSession
- isNoContent() - Method in class org.springframework.test.web.reactive.server.StatusAssertions
-
Assert the response status code is
HttpStatus.NO_CONTENT
(204). - isNoContent() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.NO_CONTENT
(204). - isNonAuthoritativeInformation() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.NON_AUTHORITATIVE_INFORMATION
(203). - isNotAcceptable() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.NOT_ACCEPTABLE
(406). - isNotEmpty() - Method in class org.springframework.test.web.client.match.JsonPathRequestMatchers
-
Evaluate the JSON path expression against the request content and assert that a non-empty value exists at the given path.
- isNotEmpty() - Method in class org.springframework.test.web.reactive.server.JsonPathAssertions
- isNotEmpty() - Method in class org.springframework.test.web.servlet.result.JsonPathResultMatchers
-
Evaluate the JSON path expression against the response content and assert that a non-empty value exists at the given path.
- isNotExtended() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.NOT_EXTENDED
(510). - isNotFound() - Method in class org.springframework.test.web.reactive.server.StatusAssertions
-
Assert the response status code is
HttpStatus.NOT_FOUND
(404). - isNotFound() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.NOT_FOUND
(404). - isNotImplemented() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.NOT_IMPLEMENTED
(501). - isNotModified() - Method in class org.springframework.test.web.reactive.server.StatusAssertions
-
Assert the response status code is
HttpStatus.NOT_MODIFIED
(304). - isNotModified() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.NOT_MODIFIED
(304). - isNumber() - Method in class org.springframework.test.web.client.match.JsonPathRequestMatchers
-
Evaluate the JSON path expression against the request content and assert that the result is a
Number
. - isNumber() - Method in class org.springframework.test.web.reactive.server.JsonPathAssertions
- isNumber() - Method in class org.springframework.test.web.servlet.result.JsonPathResultMatchers
-
Evaluate the JSON path expression against the response content and assert that the result is a
Number
. - isOk() - Method in class org.springframework.test.web.reactive.server.StatusAssertions
-
Assert the response status code is
HttpStatus.OK
(200). - isOk() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.OK
(200). - ISOLATED - Enum constant in enum class org.springframework.test.context.jdbc.SqlConfig.TransactionMode
-
Indicates that SQL scripts should always be executed in a new, isolated transaction that will be immediately committed.
- isOutputStreamAccessAllowed() - Method in class org.springframework.mock.web.MockHttpServletResponse
-
Return whether
MockHttpServletResponse.getOutputStream()
access is allowed. - isPartialContent() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.PARTIAL_CONTENT
(206). - isPayloadTooLarge() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.PAYLOAD_TOO_LARGE
(413). - isPaymentRequired() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.PAYMENT_REQUIRED
(402). - isPermanentRedirect() - Method in class org.springframework.test.web.reactive.server.StatusAssertions
-
Assert the response status code is
HttpStatus.PERMANENT_REDIRECT
(308). - isPermanentRedirect() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.PERMANENT_REDIRECT
(308). - isPreconditionFailed() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.PRECONDITION_FAILED
(412). - isPreconditionRequired() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.PRECONDITION_REQUIRED
(428). - isProcessing() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.PROCESSING
(102). - isProxyAuthenticationRequired() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.PROXY_AUTHENTICATION_REQUIRED
(407). - isReady() - Method in class org.springframework.mock.web.DelegatingServletInputStream
- isReady() - Method in class org.springframework.mock.web.DelegatingServletOutputStream
- isRequestedRangeNotSatisfiable() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.REQUESTED_RANGE_NOT_SATISFIABLE
(416). - isRequestedSessionIdFromCookie() - Method in class org.springframework.mock.web.MockHttpServletRequest
- isRequestedSessionIdFromURL() - Method in class org.springframework.mock.web.MockHttpServletRequest
- isRequestedSessionIdValid() - Method in class org.springframework.mock.web.MockHttpServletRequest
- isRequestEntityTooLarge() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Deprecated.matching the deprecation of
HttpStatus.REQUEST_ENTITY_TOO_LARGE
- isRequestHeaderFieldsTooLarge() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.REQUEST_HEADER_FIELDS_TOO_LARGE
(431). - isRequestTimeout() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.REQUEST_TIMEOUT
(408). - isRequestUriTooLong() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Deprecated.matching the deprecation of
HttpStatus.REQUEST_URI_TOO_LONG
- isResetContent() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.RESET_CONTENT
(205). - isRollback(TestContext) - Method in class org.springframework.test.context.transaction.TransactionalTestExecutionListener
-
Determine whether to rollback transactions for the supplied test context by taking into consideration the default rollback flag and a possible method-level override via the
@Rollback
annotation. - isSatisfied() - Method in class org.springframework.test.web.client.DefaultRequestExpectation
- isSatisfied() - Method in class org.springframework.test.web.client.DefaultRequestExpectation.RequestCount
- isSatisfied() - Method in interface org.springframework.test.web.client.RequestExpectation
-
Whether the requirements for this request expectation have been met.
- isSecure() - Method in class org.springframework.mock.web.MockHttpServletRequest
- isSecure() - Method in class org.springframework.mock.web.MockSessionCookieConfig
- isSeeOther() - Method in class org.springframework.test.web.reactive.server.StatusAssertions
-
Assert the response status code is
HttpStatus.SEE_OTHER
(303). - isSeeOther() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.SEE_OTHER
(303). - isServiceUnavailable() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.SERVICE_UNAVAILABLE
(503). - isStarted() - Method in class org.springframework.mock.web.server.MockWebSession
- isString() - Method in class org.springframework.test.web.client.match.JsonPathRequestMatchers
-
Evaluate the JSON path expression against the request content and assert that the result is a
String
. - isString() - Method in class org.springframework.test.web.servlet.result.JsonPathResultMatchers
-
Evaluate the JSON path expression against the response content and assert that the result is a
String
. - isSupportedTestClass(Class<?>) - Method in class org.springframework.test.context.aot.AotTestContextInitializers
-
Determine if the specified test class has an AOT-optimized application context initializer.
- isSwitchingProtocols() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.SWITCHING_PROTOCOLS
(101). - isTemporaryRedirect() - Method in class org.springframework.test.web.reactive.server.StatusAssertions
-
Assert the response status code is
HttpStatus.TEMPORARY_REDIRECT
(307). - isTemporaryRedirect() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.TEMPORARY_REDIRECT
(307). - isTestEnabledInThisEnvironment(Class<?>) - Static method in class org.springframework.test.annotation.ProfileValueUtils
-
Determine if the supplied
testClass
is enabled in the current environment, as specified by the@IfProfileValue
annotation at the class level. - isTestEnabledInThisEnvironment(Method, Class<?>) - Static method in class org.springframework.test.annotation.ProfileValueUtils
-
Determine if the supplied
testMethod
is enabled in the current environment, as specified by the@IfProfileValue
annotation, which may be declared on the test method itself or at the class level. - isTestEnabledInThisEnvironment(ProfileValueSource, Method, Class<?>) - Static method in class org.springframework.test.annotation.ProfileValueUtils
-
Determine if the supplied
testMethod
is enabled in the current environment, as specified by the@IfProfileValue
annotation, which may be declared on the test method itself or at the class level. - isTestMethodIgnored(FrameworkMethod) - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
-
Return
true
if@Ignore
is present for the supplied test method or if the test method is disabled via@IfProfileValue
. - isTooEarly() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.TOO_EARLY
(425). - isTooManyRequests() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.TOO_MANY_REQUESTS
(429). - isUnauthorized() - Method in class org.springframework.test.web.reactive.server.StatusAssertions
-
Assert the response status code is
HttpStatus.UNAUTHORIZED
(401). - isUnauthorized() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.UNAUTHORIZED
(401). - isUnavailableForLegalReasons() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.UNAVAILABLE_FOR_LEGAL_REASONS
(451). - isUnprocessableEntity() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.UNPROCESSABLE_ENTITY
(422). - isUnsupportedMediaType() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.UNSUPPORTED_MEDIA_TYPE
(415). - isUpgradeRequired() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.UPGRADE_REQUIRED
(426). - isUriTooLong() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.REQUEST_URI_TOO_LONG
(414). - isUseProxy() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Deprecated.matching the deprecation of
HttpStatus.USE_PROXY
- isUserInRole(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
- isVariantAlsoNegotiates() - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the response status code is
HttpStatus.VARIANT_ALSO_NEGOTIATES
(506). - isWriterAccessAllowed() - Method in class org.springframework.mock.web.MockHttpServletResponse
-
Return whether
MockHttpServletResponse.getOutputStream()
access is allowed.
J
- javascriptEnabled(boolean) - Method in class org.springframework.test.web.servlet.htmlunit.webdriver.MockMvcHtmlUnitDriverBuilder
-
Specify whether JavaScript should be enabled.
- jdbcTemplate - Variable in class org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests
-
The
JdbcTemplate
that this base class manages, available to subclasses. - jdbcTemplate - Variable in class org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests
-
The
JdbcTemplate
that this base class manages, available to subclasses. - JdbcTestUtils - Class in org.springframework.test.jdbc
-
JdbcTestUtils
is a collection of JDBC related utility functions intended to simplify standard database testing scenarios. - JdbcTestUtils() - Constructor for class org.springframework.test.jdbc.JdbcTestUtils
- json(String) - Method in class org.springframework.test.web.client.match.ContentRequestMatchers
-
Parse the expected and actual strings as JSON and assert the two are "similar" - i.e.
- json(String) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.BodyContentSpec
-
Parse the expected and actual response content as JSON and perform a comparison verifying that they contain the same attribute-value pairs regardless of formatting with lenient checking (extensible and non-strict array ordering).
- json(String) - Method in class org.springframework.test.web.servlet.result.ContentResultMatchers
-
Parse the expected and actual strings as JSON and assert the two are "similar" - i.e.
- json(String, boolean) - Method in class org.springframework.test.web.client.match.ContentRequestMatchers
-
Parse the request body and the given string as JSON and assert the two are "similar" - i.e.
- json(String, boolean) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.BodyContentSpec
-
Parse the expected and actual response content as JSON and perform a comparison verifying that they contain the same attribute-value pairs regardless of formatting.
- json(String, boolean) - Method in class org.springframework.test.web.servlet.result.ContentResultMatchers
-
Parse the response content and the given string as JSON and assert the two are "similar" - i.e.
- JsonExpectationsHelper - Class in org.springframework.test.util
-
A helper class for assertions on JSON content.
- JsonExpectationsHelper() - Constructor for class org.springframework.test.util.JsonExpectationsHelper
- jsonPath(String, Object...) - Static method in class org.springframework.test.web.client.match.MockRestRequestMatchers
-
Access to request body matchers using a JsonPath expression to inspect a specific subset of the body.
- jsonPath(String, Object...) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.BodyContentSpec
-
Access to response body assertions using a JsonPath expression to inspect a specific subset of the body.
- jsonPath(String, Object...) - Static method in class org.springframework.test.web.servlet.result.MockMvcResultMatchers
-
Access to response body assertions using a JsonPath expression to inspect a specific subset of the body.
- jsonPath(String, Matcher<? super T>) - Static method in class org.springframework.test.web.client.match.MockRestRequestMatchers
-
Access to request body matchers using a JsonPath expression to inspect a specific subset of the body and a Hamcrest match for asserting the value found at the JSON path.
- jsonPath(String, Matcher<? super T>) - Static method in class org.springframework.test.web.servlet.result.MockMvcResultMatchers
- jsonPath(String, Matcher<? super T>, Class<T>) - Static method in class org.springframework.test.web.servlet.result.MockMvcResultMatchers
- JsonPathAssertions - Class in org.springframework.test.web.reactive.server
-
JsonPath assertions.
- JsonPathExpectationsHelper - Class in org.springframework.test.util
-
A helper class for applying assertions via JSON path expressions.
- JsonPathExpectationsHelper(String, Object...) - Constructor for class org.springframework.test.util.JsonPathExpectationsHelper
-
Construct a new
JsonPathExpectationsHelper
. - JsonPathRequestMatchers - Class in org.springframework.test.web.client.match
-
Factory for assertions on the request content using JsonPath expressions.
- JsonPathRequestMatchers(String, Object...) - Constructor for class org.springframework.test.web.client.match.JsonPathRequestMatchers
-
Protected constructor.
- JsonPathResultMatchers - Class in org.springframework.test.web.servlet.result
-
Factory for assertions on the response content using JsonPath expressions.
- JsonPathResultMatchers(String, Object...) - Constructor for class org.springframework.test.web.servlet.result.JsonPathResultMatchers
-
Protected constructor.
L
- lastModified(long) - Method in class org.springframework.test.web.reactive.server.HeaderAssertions
-
Expect a "Last-Modified" header with the given value.
- listeners() - Element in annotation interface org.springframework.test.context.TestExecutionListeners
-
The
TestExecutionListeners
to register with theTestContextManager
. - loadBeanDefinitions(GenericApplicationContext, MergedContextConfiguration) - Method in class org.springframework.test.context.support.AbstractGenericContextLoader
-
Load bean definitions into the supplied
context
from the locations or classes in the suppliedMergedContextConfiguration
. - loadBeanDefinitions(GenericApplicationContext, MergedContextConfiguration) - Method in class org.springframework.test.context.support.AnnotationConfigContextLoader
-
Register classes in the supplied
context
from the classes in the suppliedMergedContextConfiguration
. - loadBeanDefinitions(GenericApplicationContext, MergedContextConfiguration) - Method in class org.springframework.test.context.support.GenericGroovyXmlContextLoader
-
Load bean definitions into the supplied
context
from the locations in the suppliedMergedContextConfiguration
using aGroovyBeanDefinitionReader
. - loadBeanDefinitions(GenericWebApplicationContext, WebMergedContextConfiguration) - Method in class org.springframework.test.context.web.AbstractGenericWebContextLoader
-
Load bean definitions into the supplied
context
from the locations or classes in the suppliedWebMergedContextConfiguration
. - loadBeanDefinitions(GenericWebApplicationContext, WebMergedContextConfiguration) - Method in class org.springframework.test.context.web.AnnotationConfigWebContextLoader
-
Register classes in the supplied context from the classes in the supplied
WebMergedContextConfiguration
. - loadBeanDefinitions(GenericWebApplicationContext, WebMergedContextConfiguration) - Method in class org.springframework.test.context.web.GenericGroovyXmlWebContextLoader
-
Load bean definitions into the supplied
context
from the locations in the suppliedWebMergedContextConfiguration
using aGroovyBeanDefinitionReader
. - loadBeanDefinitions(GenericWebApplicationContext, WebMergedContextConfiguration) - Method in class org.springframework.test.context.web.GenericXmlWebContextLoader
-
Load bean definitions into the supplied
context
from the locations in the suppliedWebMergedContextConfiguration
, using anXmlBeanDefinitionReader
. - loadContext() - Element in annotation interface org.springframework.test.context.junit.jupiter.DisabledIf
-
Whether the
ApplicationContext
associated with the current test should be eagerly loaded in order to evaluate theDisabledIf.expression()
. - loadContext() - Element in annotation interface org.springframework.test.context.junit.jupiter.EnabledIf
-
Whether the
ApplicationContext
associated with the current test should be eagerly loaded in order to evaluate theEnabledIf.expression()
. - loadContext(String...) - Method in interface org.springframework.test.context.ContextLoader
-
Deprecated.as of Spring Framework 6.0, in favor of methods defined in the
SmartContextLoader
SPI - loadContext(String...) - Method in interface org.springframework.test.context.SmartContextLoader
-
SmartContextLoader
does not support deprecatedContextLoader
methods. - loadContext(String...) - Method in class org.springframework.test.context.support.AbstractGenericContextLoader
-
Deprecated.as of Spring Framework 6.0, in favor of
AbstractGenericContextLoader.loadContext(MergedContextConfiguration)
- loadContext(String...) - Method in class org.springframework.test.context.web.AbstractGenericWebContextLoader
-
AbstractGenericWebContextLoader
should be used as aSmartContextLoader
, not as a legacyContextLoader
. - loadContext(MergedContextConfiguration) - Method in class org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate
- loadContext(MergedContextConfiguration) - Method in interface org.springframework.test.context.CacheAwareContextLoaderDelegate
-
Load the application context for the supplied
MergedContextConfiguration
by delegating to theContextLoader
configured in the givenMergedContextConfiguration
. - loadContext(MergedContextConfiguration) - Method in interface org.springframework.test.context.SmartContextLoader
-
Load a new
ApplicationContext
based on the suppliedMergedContextConfiguration
, configure the context, and return the context in a fully refreshed state. - loadContext(MergedContextConfiguration) - Method in class org.springframework.test.context.support.AbstractDelegatingSmartContextLoader
-
Delegates to an appropriate candidate
SmartContextLoader
to load anApplicationContext
. - loadContext(MergedContextConfiguration) - Method in class org.springframework.test.context.support.AbstractGenericContextLoader
-
Load a
GenericApplicationContext
for the suppliedMergedContextConfiguration
. - loadContext(MergedContextConfiguration) - Method in class org.springframework.test.context.web.AbstractGenericWebContextLoader
-
Load a
GenericWebApplicationContext
for the suppliedMergedContextConfiguration
. - loadContextForAotProcessing(MergedContextConfiguration) - Method in interface org.springframework.test.context.aot.AotContextLoader
-
Load a new
ApplicationContext
for AOT build-time processing based on the suppliedMergedContextConfiguration
, configure the context, and return the context. - loadContextForAotProcessing(MergedContextConfiguration) - Method in class org.springframework.test.context.support.AbstractDelegatingSmartContextLoader
-
Delegates to an appropriate candidate
SmartContextLoader
to load anApplicationContext
for AOT processing. - loadContextForAotProcessing(MergedContextConfiguration) - Method in class org.springframework.test.context.support.AbstractGenericContextLoader
-
Load a
GenericApplicationContext
for AOT build-time processing based on the suppliedMergedContextConfiguration
. - loadContextForAotProcessing(MergedContextConfiguration) - Method in class org.springframework.test.context.web.AbstractGenericWebContextLoader
-
Load a
GenericWebApplicationContext
for AOT build-time processing based on the suppliedMergedContextConfiguration
. - loadContextForAotRuntime(MergedContextConfiguration, ApplicationContextInitializer<ConfigurableApplicationContext>) - Method in interface org.springframework.test.context.aot.AotContextLoader
-
Load a new
ApplicationContext
for AOT run-time execution based on the suppliedMergedContextConfiguration
andApplicationContextInitializer
. - loadContextForAotRuntime(MergedContextConfiguration, ApplicationContextInitializer<ConfigurableApplicationContext>) - Method in class org.springframework.test.context.support.AbstractDelegatingSmartContextLoader
-
Delegates to an appropriate candidate
SmartContextLoader
to load anApplicationContext
for AOT run-time execution. - loadContextForAotRuntime(MergedContextConfiguration, ApplicationContextInitializer<ConfigurableApplicationContext>) - Method in class org.springframework.test.context.support.AbstractGenericContextLoader
-
Load a
GenericApplicationContext
for AOT run-time execution based on the suppliedMergedContextConfiguration
andApplicationContextInitializer
. - loadContextForAotRuntime(MergedContextConfiguration, ApplicationContextInitializer<ConfigurableApplicationContext>) - Method in class org.springframework.test.context.web.AbstractGenericWebContextLoader
-
Load a
GenericWebApplicationContext
for AOT run-time execution based on the suppliedMergedContextConfiguration
andApplicationContextInitializer
. - loadContextInAotMode(AotMergedContextConfiguration) - Method in class org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate
- loadContextInternal(MergedContextConfiguration) - Method in class org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate
-
Load the
ApplicationContext
for the supplied merged context configuration. - loader() - Element in annotation interface org.springframework.test.context.ContextConfiguration
- loader() - Element in annotation interface org.springframework.test.context.junit.jupiter.SpringJUnitConfig
-
Alias for
ContextConfiguration.loader()
. - loader() - Element in annotation interface org.springframework.test.context.junit.jupiter.web.SpringJUnitWebConfig
-
Alias for
ContextConfiguration.loader()
. - loadFactoryImplementations(Class<T>) - Static method in class org.springframework.test.context.util.TestContextSpringFactoriesUtils
-
Load factory implementations of the given type via the
SpringFactoriesLoader
mechanism. - localAddress() - Method in class org.springframework.mock.web.reactive.function.server.MockServerRequest
- localAddress(InetSocketAddress) - Method in interface org.springframework.mock.http.server.reactive.MockServerHttpRequest.BaseBuilder
-
Set the local address to return.
- localAddress(InetSocketAddress) - Method in interface org.springframework.mock.web.reactive.function.server.MockServerRequest.Builder
- locale(Locale) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Set the locale of the request, overriding any previous locales.
- locale(Locale...) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Add the specified locales as preferred request locales.
- localeResolver(LocaleResolver) - Method in interface org.springframework.test.web.servlet.client.MockMvcWebTestClient.ControllerSpec
-
Provide the LocaleResolver to use.
- location(String) - Method in class org.springframework.test.web.reactive.server.HeaderAssertions
-
Expect a "Location" header with the given value.
- location(URI) - Method in class org.springframework.test.web.client.response.DefaultResponseCreator
-
Set the
Location
header. - locations() - Element in annotation interface org.springframework.test.context.ContextConfiguration
-
The resource locations to use for loading an
ApplicationContext
. - locations() - Element in annotation interface org.springframework.test.context.junit.jupiter.SpringJUnitConfig
-
Alias for
ContextConfiguration.locations()
. - locations() - Element in annotation interface org.springframework.test.context.junit.jupiter.web.SpringJUnitWebConfig
-
Alias for
ContextConfiguration.locations()
. - locations() - Element in annotation interface org.springframework.test.context.TestPropertySource
-
The resource locations of properties files to be loaded into the
Environment
's set ofPropertySources
. - log() - Static method in class org.springframework.test.web.servlet.result.MockMvcResultHandlers
-
Log
MvcResult
details as aDEBUG
log message via Apache Commons Logging using the log categoryorg.springframework.test.web.servlet.result
. - log(String) - Method in class org.springframework.mock.web.MockServletContext
- log(String, Throwable) - Method in class org.springframework.mock.web.MockServletContext
- logger - Variable in class org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests
-
Logger available to subclasses.
- logger - Static variable in class org.springframework.test.context.junit4.statements.SpringRepeat
- logger - Static variable in class org.springframework.test.context.support.AbstractGenericContextLoader
- logger - Variable in class org.springframework.test.context.testng.AbstractTestNGSpringContextTests
-
Logger available to subclasses.
- logger - Static variable in class org.springframework.test.context.web.AbstractGenericWebContextLoader
- login(String, String) - Method in class org.springframework.mock.web.MockHttpServletRequest
- logout() - Method in class org.springframework.mock.web.MockHttpServletRequest
- logStatistics() - Method in interface org.springframework.test.context.cache.ContextCache
-
Log the statistics for this
ContextCache
atDEBUG
level using the "org.springframework.test.context.cache" logging category. - logStatistics() - Method in class org.springframework.test.context.cache.DefaultContextCache
- longValue(String, long) - Method in class org.springframework.test.web.servlet.result.HeaderResultMatchers
-
Assert the primary value of the named response header as a
long
.
M
- manyTimes() - Static method in class org.springframework.test.web.client.ExpectedCount
-
Many times (range of 1..Integer.MAX_VALUE).
- mappedInterceptors(String[], HandlerInterceptor...) - Method in interface org.springframework.test.web.servlet.client.MockMvcWebTestClient.ControllerSpec
-
Add interceptors for specific patterns.
- markApplicationContextDirty(DirtiesContext.HierarchyMode) - Method in class org.springframework.test.context.support.DefaultTestContext
-
Mark the application context associated with this test context as dirty (i.e., by removing it from the context cache and closing it).
- markApplicationContextDirty(DirtiesContext.HierarchyMode) - Method in interface org.springframework.test.context.TestContext
-
Call this method to signal that the application context associated with this test context is dirty and should be removed from the context cache.
- match(ClientHttpRequest) - Method in class org.springframework.test.web.client.DefaultRequestExpectation
- match(ClientHttpRequest) - Method in interface org.springframework.test.web.client.RequestMatcher
-
Match the given request against specific expectations.
- match(MvcResult) - Method in interface org.springframework.test.web.servlet.ResultMatcher
-
Assert the result of an executed request.
- matchAll(ResultMatcher...) - Static method in interface org.springframework.test.web.servlet.ResultMatcher
-
Deprecated.as of Spring Framework 5.3.10, in favor of
ResultActions.andExpectAll(ResultMatcher...)
- matches(WebRequest) - Method in class org.springframework.test.web.servlet.htmlunit.HostRequestMatcher
- matches(WebRequest) - Method in class org.springframework.test.web.servlet.htmlunit.UrlRegexRequestMatcher
- matches(WebRequest) - Method in interface org.springframework.test.web.servlet.htmlunit.WebRequestMatcher
-
Whether this matcher matches on the supplied web request.
- matchRequest(ClientHttpRequest) - Method in class org.springframework.test.web.client.AbstractRequestExpectationManager
-
As of 5.0.3 subclasses should implement this method instead of
#validateRequestInternal(ClientHttpRequest)
in order to match the request to an expectation, leaving the call to create the response as a separate step (to be invoked by this class). - matchRequest(ClientHttpRequest) - Method in class org.springframework.test.web.client.SimpleRequestExpectationManager
- matchRequest(ClientHttpRequest) - Method in class org.springframework.test.web.client.UnorderedRequestExpectationManager
- max(int) - Static method in class org.springframework.test.web.client.ExpectedCount
-
At most
max
number of times. - MAX_CONTEXT_CACHE_SIZE_PROPERTY_NAME - Static variable in interface org.springframework.test.context.cache.ContextCache
-
System property used to configure the maximum size of the
ContextCache
as a positive integer: "spring.test.context.cache.maxSize". - maxAge(String, int) - Method in class org.springframework.test.web.servlet.result.CookieResultMatchers
-
Assert a cookie's maxAge.
- maxAge(String, Duration) - Method in class org.springframework.test.web.reactive.server.CookieAssertions
-
Assert a cookie's maxAge attribute.
- maxAge(String, Matcher<? super Integer>) - Method in class org.springframework.test.web.servlet.result.CookieResultMatchers
-
Assert a cookie's maxAge with a Hamcrest
Matcher
. - maxAge(String, Matcher<? super Long>) - Method in class org.springframework.test.web.reactive.server.CookieAssertions
-
Assert a cookie's maxAge attribute with a Hamcrest
Matcher
. - merge(Object) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Merges the properties of the "parent" RequestBuilder accepting values only if not already set in "this" instance.
- merge(Object) - Method in class org.springframework.test.web.servlet.request.MockMultipartHttpServletRequestBuilder
- MERGE - Enum constant in enum class org.springframework.test.context.jdbc.SqlMergeMode.MergeMode
-
Indicates that method-level
@Sql
declarations should be merged with class-level@Sql
declarations, with class-level SQL scripts and statements executed before method-level scripts and statements. - MERGE_WITH_DEFAULTS - Enum constant in enum class org.springframework.test.context.ContextCustomizerFactories.MergeMode
-
Indicates that locally declared factories should be merged with the default factories.
- MERGE_WITH_DEFAULTS - Enum constant in enum class org.springframework.test.context.TestExecutionListeners.MergeMode
-
Indicates that locally declared listeners should be merged with the default listeners.
- MergedContextConfiguration - Class in org.springframework.test.context
-
MergedContextConfiguration
encapsulates the merged context configuration declared on a test class and all of its superclasses and enclosing classes via@ContextConfiguration
,@ActiveProfiles
, and@TestPropertySource
. - MergedContextConfiguration(Class<?>, String[], Class<?>[], String[], ContextLoader) - Constructor for class org.springframework.test.context.MergedContextConfiguration
-
Create a new
MergedContextConfiguration
instance for the supplied parameters. - MergedContextConfiguration(Class<?>, String[], Class<?>[], Set<Class<? extends ApplicationContextInitializer<?>>>, String[], String[], String[], Set<ContextCustomizer>, ContextLoader, CacheAwareContextLoaderDelegate, MergedContextConfiguration) - Constructor for class org.springframework.test.context.MergedContextConfiguration
- MergedContextConfiguration(Class<?>, String[], Class<?>[], Set<Class<? extends ApplicationContextInitializer<?>>>, String[], String[], String[], ContextLoader, CacheAwareContextLoaderDelegate, MergedContextConfiguration) - Constructor for class org.springframework.test.context.MergedContextConfiguration
- MergedContextConfiguration(Class<?>, String[], Class<?>[], Set<Class<? extends ApplicationContextInitializer<?>>>, String[], List<PropertySourceDescriptor>, String[], Set<ContextCustomizer>, ContextLoader, CacheAwareContextLoaderDelegate, MergedContextConfiguration) - Constructor for class org.springframework.test.context.MergedContextConfiguration
-
Create a new
MergedContextConfiguration
instance for the supplied parameters. - MergedContextConfiguration(Class<?>, String[], Class<?>[], Set<Class<? extends ApplicationContextInitializer<?>>>, String[], ContextLoader) - Constructor for class org.springframework.test.context.MergedContextConfiguration
-
Create a new
MergedContextConfiguration
instance for the supplied parameters. - MergedContextConfiguration(Class<?>, String[], Class<?>[], Set<Class<? extends ApplicationContextInitializer<?>>>, String[], ContextLoader, CacheAwareContextLoaderDelegate, MergedContextConfiguration) - Constructor for class org.springframework.test.context.MergedContextConfiguration
-
Create a new
MergedContextConfiguration
instance for the supplied parameters. - MergedContextConfiguration(MergedContextConfiguration) - Constructor for class org.springframework.test.context.MergedContextConfiguration
-
Create a new
MergedContextConfiguration
instance by copying all fields from the suppliedMergedContextConfiguration
. - mergeMode() - Element in annotation interface org.springframework.test.context.ContextCustomizerFactories
-
The merge mode to use when
@ContextCustomizerFactories
is declared on a class that does not inherit factories from a superclass or enclosing class. - mergeMode() - Element in annotation interface org.springframework.test.context.TestExecutionListeners
-
The merge mode to use when
@TestExecutionListeners
is declared on a class that does not inherit listeners from a superclass or enclosing class. - messageConverters(HttpMessageConverter<?>...) - Method in interface org.springframework.test.web.servlet.client.MockMvcWebTestClient.ControllerSpec
-
Set the message converters to use.
- messageReaders() - Method in class org.springframework.mock.web.reactive.function.server.MockServerRequest
- messageReaders(List<HttpMessageReader<?>>) - Method in interface org.springframework.mock.web.reactive.function.server.MockServerRequest.Builder
- method() - Method in class org.springframework.mock.web.reactive.function.server.MockServerRequest
- method(Method) - Method in class org.springframework.test.web.servlet.result.HandlerResultMatchers
-
Assert the controller method used to process the request.
- method(String, String, Object...) - Static method in class org.springframework.mock.http.server.reactive.MockServerHttpRequest
-
Deprecated.as of Spring Framework 6.0 in favor of
MockServerHttpRequest.method(HttpMethod, String, Object...)
- method(HttpMethod) - Method in interface org.springframework.mock.web.reactive.function.server.MockServerRequest.Builder
- method(HttpMethod) - Static method in class org.springframework.test.web.client.match.MockRestRequestMatchers
-
Assert the
HttpMethod
of the request. - method(HttpMethod) - Method in interface org.springframework.test.web.reactive.server.WebTestClient
-
Prepare a request for the specified
HttpMethod
. - method(HttpMethod, String, Object...) - Static method in class org.springframework.mock.http.server.reactive.MockServerHttpRequest
-
Alternative to
MockServerHttpRequest.method(HttpMethod, URI)
that accepts a URI template. - method(HttpMethod, URI) - Static method in class org.springframework.mock.http.server.reactive.MockServerHttpRequest
-
Create a builder with the given HTTP method and a
URI
. - methodBlock(FrameworkMethod) - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
-
Augment the default JUnit behavior with potential repeats of the entire execution chain.
- methodCall(Object) - Method in class org.springframework.test.web.servlet.result.HandlerResultMatchers
-
Assert the controller method used to process the request.
- MethodInvoker - Interface in org.springframework.test.context
-
MethodInvoker
defines a generic API for invoking aMethod
within the Spring TestContext Framework. - methodMode() - Element in annotation interface org.springframework.test.annotation.DirtiesContext
-
The mode to use when a test method is annotated with
@DirtiesContext
. - methodName() - Method in class org.springframework.mock.web.reactive.function.server.MockServerRequest
-
Deprecated.
- methodName(String) - Method in class org.springframework.test.web.servlet.result.HandlerResultMatchers
-
Assert the name of the controller method used to process the request.
- methodName(Matcher<? super String>) - Method in class org.springframework.test.web.servlet.result.HandlerResultMatchers
-
Assert the name of the controller method used to process the request using the given Hamcrest
Matcher
. - millis() - Element in annotation interface org.springframework.test.annotation.Timed
-
The maximum amount of time (in milliseconds) that a test execution can take without being marked as failed due to taking too long.
- min(int) - Static method in class org.springframework.test.web.client.ExpectedCount
-
At least
min
number of times. - MOCK_PROPERTIES_PROPERTY_SOURCE_NAME - Static variable in class org.springframework.mock.env.MockPropertySource
-
"mockProperties" is the default name for
MockPropertySource
instances not otherwise given an explicit name. - MockAsyncContext - Class in org.springframework.mock.web
-
Mock implementation of the
AsyncContext
interface. - MockAsyncContext(ServletRequest, ServletResponse) - Constructor for class org.springframework.mock.web.MockAsyncContext
- MockBodyContent - Class in org.springframework.mock.web
-
Mock implementation of the
BodyContent
class. - MockBodyContent(String, HttpServletResponse) - Constructor for class org.springframework.mock.web.MockBodyContent
-
Create a MockBodyContent for the given response.
- MockBodyContent(String, HttpServletResponse, Writer) - Constructor for class org.springframework.mock.web.MockBodyContent
-
Create a MockBodyContent for the given response.
- MockBodyContent(String, Writer) - Constructor for class org.springframework.mock.web.MockBodyContent
-
Create a MockBodyContent for the given response.
- MockClientHttpRequest - Class in org.springframework.mock.http.client
-
Mock implementation of
ClientHttpRequest
. - MockClientHttpRequest - Class in org.springframework.mock.http.client.reactive
-
Mock implementation of
ClientHttpRequest
. - MockClientHttpRequest() - Constructor for class org.springframework.mock.http.client.MockClientHttpRequest
- MockClientHttpRequest(HttpMethod, String, Object...) - Constructor for class org.springframework.mock.http.client.MockClientHttpRequest
-
Create a
MockClientHttpRequest
with the givenHttpMethod
, URI template, and URI template variable values. - MockClientHttpRequest(HttpMethod, String, Object...) - Constructor for class org.springframework.mock.http.client.reactive.MockClientHttpRequest
- MockClientHttpRequest(HttpMethod, URI) - Constructor for class org.springframework.mock.http.client.MockClientHttpRequest
- MockClientHttpRequest(HttpMethod, URI) - Constructor for class org.springframework.mock.http.client.reactive.MockClientHttpRequest
- MockClientHttpResponse - Class in org.springframework.mock.http.client
-
Mock implementation of
ClientHttpResponse
. - MockClientHttpResponse - Class in org.springframework.mock.http.client.reactive
-
Mock implementation of
ClientHttpResponse
. - MockClientHttpResponse() - Constructor for class org.springframework.mock.http.client.MockClientHttpResponse
-
Create a
MockClientHttpResponse
with an empty response body and HTTP status codeOK
. - MockClientHttpResponse(byte[], int) - Constructor for class org.springframework.mock.http.client.MockClientHttpResponse
-
Create a
MockClientHttpResponse
with response body as a byte array and a custom HTTP status code. - MockClientHttpResponse(byte[], HttpStatusCode) - Constructor for class org.springframework.mock.http.client.MockClientHttpResponse
-
Create a
MockClientHttpResponse
with response body as a byte array and the supplied HTTP status code. - MockClientHttpResponse(int) - Constructor for class org.springframework.mock.http.client.reactive.MockClientHttpResponse
- MockClientHttpResponse(InputStream, int) - Constructor for class org.springframework.mock.http.client.MockClientHttpResponse
-
Create a
MockClientHttpResponse
with response body asInputStream
and a custom HTTP status code. - MockClientHttpResponse(InputStream, HttpStatusCode) - Constructor for class org.springframework.mock.http.client.MockClientHttpResponse
-
Create a
MockClientHttpResponse
with response body asInputStream
and the supplied HTTP status code. - MockClientHttpResponse(HttpStatusCode) - Constructor for class org.springframework.mock.http.client.reactive.MockClientHttpResponse
- MockCookie - Class in org.springframework.mock.web
-
Extension of
Cookie
with extra attributes, as defined in RFC 6265. - MockCookie(String, String) - Constructor for class org.springframework.mock.web.MockCookie
-
Construct a new
MockCookie
with the supplied name and value. - MockEnvironment - Class in org.springframework.mock.env
-
Simple
ConfigurableEnvironment
implementation exposingMockEnvironment.setProperty(java.lang.String, java.lang.String)
andMockEnvironment.withProperty(java.lang.String, java.lang.String)
methods for testing purposes. - MockEnvironment() - Constructor for class org.springframework.mock.env.MockEnvironment
-
Create a new
MockEnvironment
with a singleMockPropertySource
. - MockFilterChain - Class in org.springframework.mock.web
-
Mock implementation of the
FilterChain
interface. - MockFilterChain() - Constructor for class org.springframework.mock.web.MockFilterChain
-
Create an empty
MockFilterChain
without any filters. - MockFilterChain(Servlet) - Constructor for class org.springframework.mock.web.MockFilterChain
-
Create a
MockFilterChain
with aServlet
. - MockFilterChain(Servlet, Filter...) - Constructor for class org.springframework.mock.web.MockFilterChain
- MockFilterConfig - Class in org.springframework.mock.web
-
Mock implementation of the
FilterConfig
interface. - MockFilterConfig() - Constructor for class org.springframework.mock.web.MockFilterConfig
-
Create a new MockFilterConfig with a default
MockServletContext
. - MockFilterConfig(ServletContext) - Constructor for class org.springframework.mock.web.MockFilterConfig
-
Create a new MockFilterConfig.
- MockFilterConfig(ServletContext, String) - Constructor for class org.springframework.mock.web.MockFilterConfig
-
Create a new MockFilterConfig.
- MockFilterConfig(String) - Constructor for class org.springframework.mock.web.MockFilterConfig
-
Create a new MockFilterConfig with a default
MockServletContext
. - MockHttpInputMessage - Class in org.springframework.mock.http
-
Mock implementation of
HttpInputMessage
. - MockHttpInputMessage(byte[]) - Constructor for class org.springframework.mock.http.MockHttpInputMessage
-
Create a
MockHttpInputMessage
with the supplied body. - MockHttpInputMessage(InputStream) - Constructor for class org.springframework.mock.http.MockHttpInputMessage
-
Create a
MockHttpInputMessage
with the supplied body. - MockHttpOutputMessage - Class in org.springframework.mock.http
-
Mock implementation of
HttpOutputMessage
. - MockHttpOutputMessage() - Constructor for class org.springframework.mock.http.MockHttpOutputMessage
- MockHttpServletMapping - Class in org.springframework.mock.web
-
Mock implementation of
HttpServletMapping
. - MockHttpServletMapping(String, String, String, MappingMatch) - Constructor for class org.springframework.mock.web.MockHttpServletMapping
- MockHttpServletRequest - Class in org.springframework.mock.web
-
Mock implementation of the
HttpServletRequest
interface. - MockHttpServletRequest() - Constructor for class org.springframework.mock.web.MockHttpServletRequest
-
Create a new
MockHttpServletRequest
with a defaultMockServletContext
. - MockHttpServletRequest(ServletContext) - Constructor for class org.springframework.mock.web.MockHttpServletRequest
-
Create a new
MockHttpServletRequest
with the suppliedServletContext
. - MockHttpServletRequest(ServletContext, String, String) - Constructor for class org.springframework.mock.web.MockHttpServletRequest
- MockHttpServletRequest(String, String) - Constructor for class org.springframework.mock.web.MockHttpServletRequest
-
Create a new
MockHttpServletRequest
with a defaultMockServletContext
. - MockHttpServletRequestBuilder - Class in org.springframework.test.web.servlet.request
-
Default builder for
MockHttpServletRequest
required as input to perform requests inMockMvc
. - MockHttpServletResponse - Class in org.springframework.mock.web
-
Mock implementation of the
HttpServletResponse
interface. - MockHttpServletResponse() - Constructor for class org.springframework.mock.web.MockHttpServletResponse
- MockHttpSession - Class in org.springframework.mock.web
-
Mock implementation of the
HttpSession
interface. - MockHttpSession() - Constructor for class org.springframework.mock.web.MockHttpSession
-
Create a new MockHttpSession with a default
MockServletContext
. - MockHttpSession(ServletContext) - Constructor for class org.springframework.mock.web.MockHttpSession
-
Create a new MockHttpSession.
- MockHttpSession(ServletContext, String) - Constructor for class org.springframework.mock.web.MockHttpSession
-
Create a new MockHttpSession.
- MockJspWriter - Class in org.springframework.mock.web
-
Mock implementation of the
JspWriter
class. - MockJspWriter(HttpServletResponse) - Constructor for class org.springframework.mock.web.MockJspWriter
-
Create a MockJspWriter for the given response, using the response's default Writer.
- MockJspWriter(HttpServletResponse, Writer) - Constructor for class org.springframework.mock.web.MockJspWriter
-
Create a MockJspWriter for the given response.
- MockJspWriter(Writer) - Constructor for class org.springframework.mock.web.MockJspWriter
-
Create a MockJspWriter for the given plain Writer.
- MockMultipartFile - Class in org.springframework.mock.web
-
Mock implementation of the
MultipartFile
interface. - MockMultipartFile(String, byte[]) - Constructor for class org.springframework.mock.web.MockMultipartFile
-
Create a new MockMultipartFile with the given content.
- MockMultipartFile(String, InputStream) - Constructor for class org.springframework.mock.web.MockMultipartFile
-
Create a new MockMultipartFile with the given content.
- MockMultipartFile(String, String, String, byte[]) - Constructor for class org.springframework.mock.web.MockMultipartFile
-
Create a new MockMultipartFile with the given content.
- MockMultipartFile(String, String, String, InputStream) - Constructor for class org.springframework.mock.web.MockMultipartFile
-
Create a new MockMultipartFile with the given content.
- MockMultipartHttpServletRequest - Class in org.springframework.mock.web
-
Mock implementation of the
MultipartHttpServletRequest
interface. - MockMultipartHttpServletRequest() - Constructor for class org.springframework.mock.web.MockMultipartHttpServletRequest
-
Create a new
MockMultipartHttpServletRequest
with a defaultMockServletContext
. - MockMultipartHttpServletRequest(ServletContext) - Constructor for class org.springframework.mock.web.MockMultipartHttpServletRequest
-
Create a new
MockMultipartHttpServletRequest
with the suppliedServletContext
. - MockMultipartHttpServletRequestBuilder - Class in org.springframework.test.web.servlet.request
-
Default builder for
MockMultipartHttpServletRequest
. - MockMvc - Class in org.springframework.test.web.servlet
-
Main entry point for server-side Spring MVC test support.
- MockMvcBuilder - Interface in org.springframework.test.web.servlet
-
Builds a
MockMvc
instance. - MockMvcBuilders - Class in org.springframework.test.web.servlet.setup
-
The main class to import in order to access all available
MockMvcBuilders
. - MockMvcBuilderSupport - Class in org.springframework.test.web.servlet
-
Base class for MockMvc builder implementations, providing the capability to create a
MockMvc
instance. - MockMvcBuilderSupport() - Constructor for class org.springframework.test.web.servlet.MockMvcBuilderSupport
- MockMvcClientHttpRequestFactory - Class in org.springframework.test.web.client
-
A
ClientHttpRequestFactory
for requests executed viaMockMvc
. - MockMvcClientHttpRequestFactory(MockMvc) - Constructor for class org.springframework.test.web.client.MockMvcClientHttpRequestFactory
- MockMvcConfigurer - Interface in org.springframework.test.web.servlet.setup
-
Contract for customizing a
ConfigurableMockMvcBuilder
in some specific way, e.g. - MockMvcConfigurerAdapter - Class in org.springframework.test.web.servlet.setup
-
An empty method implementation of
MockMvcConfigurer
. - MockMvcConfigurerAdapter() - Constructor for class org.springframework.test.web.servlet.setup.MockMvcConfigurerAdapter
- MockMvcHtmlUnitDriverBuilder - Class in org.springframework.test.web.servlet.htmlunit.webdriver
-
MockMvcHtmlUnitDriverBuilder
simplifies the building of anHtmlUnitDriver
that delegates toMockMvc
and optionally delegates to an actual connection for specific requests. - MockMvcHtmlUnitDriverBuilder(MockMvc) - Constructor for class org.springframework.test.web.servlet.htmlunit.webdriver.MockMvcHtmlUnitDriverBuilder
- MockMvcHtmlUnitDriverBuilder(WebApplicationContext) - Constructor for class org.springframework.test.web.servlet.htmlunit.webdriver.MockMvcHtmlUnitDriverBuilder
- MockMvcHtmlUnitDriverBuilder(WebApplicationContext, MockMvcConfigurer) - Constructor for class org.springframework.test.web.servlet.htmlunit.webdriver.MockMvcHtmlUnitDriverBuilder
- MockMvcHttpConnector - Class in org.springframework.test.web.servlet.client
-
Connector that handles requests by invoking a
MockMvc
rather than making actual requests over HTTP. - MockMvcHttpConnector(MockMvc) - Constructor for class org.springframework.test.web.servlet.client.MockMvcHttpConnector
- MockMvcRequestBuilders - Class in org.springframework.test.web.servlet.request
-
Static factory methods for
RequestBuilders
. - MockMvcRequestBuilders() - Constructor for class org.springframework.test.web.servlet.request.MockMvcRequestBuilders
- MockMvcResultHandlers - Class in org.springframework.test.web.servlet.result
-
Static factory methods for
ResultHandler
-based result actions. - MockMvcResultHandlers() - Constructor for class org.springframework.test.web.servlet.result.MockMvcResultHandlers
- MockMvcResultMatchers - Class in org.springframework.test.web.servlet.result
-
Static factory methods for
ResultMatcher
-based result actions. - MockMvcResultMatchers() - Constructor for class org.springframework.test.web.servlet.result.MockMvcResultMatchers
- mockMvcSetup(MockMvc) - Static method in class org.springframework.test.web.servlet.htmlunit.MockMvcWebClientBuilder
-
Create a new
MockMvcWebClientBuilder
based on the suppliedMockMvc
instance. - mockMvcSetup(MockMvc) - Static method in class org.springframework.test.web.servlet.htmlunit.webdriver.MockMvcHtmlUnitDriverBuilder
-
Create a new
MockMvcHtmlUnitDriverBuilder
based on the suppliedMockMvc
instance. - MockMvcWebClientBuilder - Class in org.springframework.test.web.servlet.htmlunit
-
MockMvcWebClientBuilder
simplifies the creation of an HtmlUnitWebClient
that delegates to aMockMvc
instance. - MockMvcWebClientBuilder(MockMvc) - Constructor for class org.springframework.test.web.servlet.htmlunit.MockMvcWebClientBuilder
- MockMvcWebClientBuilder(WebApplicationContext) - Constructor for class org.springframework.test.web.servlet.htmlunit.MockMvcWebClientBuilder
- MockMvcWebClientBuilder(WebApplicationContext, MockMvcConfigurer) - Constructor for class org.springframework.test.web.servlet.htmlunit.MockMvcWebClientBuilder
- MockMvcWebConnection - Class in org.springframework.test.web.servlet.htmlunit
- MockMvcWebConnection(MockMvc, WebClient) - Constructor for class org.springframework.test.web.servlet.htmlunit.MockMvcWebConnection
-
Create a new instance that assumes the context path of the application is
""
(i.e., the root context). - MockMvcWebConnection(MockMvc, WebClient, String) - Constructor for class org.springframework.test.web.servlet.htmlunit.MockMvcWebConnection
-
Create a new instance with the specified context path.
- MockMvcWebConnectionBuilderSupport<T extends MockMvcWebConnectionBuilderSupport<T>> - Class in org.springframework.test.web.servlet.htmlunit
-
Support class that simplifies the creation of a
WebConnection
that usesMockMvc
and optionally delegates to a realWebConnection
for specific requests. - MockMvcWebConnectionBuilderSupport(MockMvc) - Constructor for class org.springframework.test.web.servlet.htmlunit.MockMvcWebConnectionBuilderSupport
-
Create a new instance using the supplied
MockMvc
instance. - MockMvcWebConnectionBuilderSupport(WebApplicationContext) - Constructor for class org.springframework.test.web.servlet.htmlunit.MockMvcWebConnectionBuilderSupport
-
Create a new instance using the supplied
WebApplicationContext
. - MockMvcWebConnectionBuilderSupport(WebApplicationContext, MockMvcConfigurer) - Constructor for class org.springframework.test.web.servlet.htmlunit.MockMvcWebConnectionBuilderSupport
-
Create a new instance using the supplied
WebApplicationContext
andMockMvcConfigurer
. - MockMvcWebTestClient - Interface in org.springframework.test.web.servlet.client
-
The main class for testing Spring MVC applications via
WebTestClient
withMockMvc
for server request handling. - MockMvcWebTestClient.ControllerSpec - Interface in org.springframework.test.web.servlet.client
-
Specification for configuring
MockMvc
to test one or more controllers directly, and a simple facade aroundStandaloneMockMvcBuilder
. - MockMvcWebTestClient.MockMvcServerSpec<B extends MockMvcWebTestClient.MockMvcServerSpec<B>> - Interface in org.springframework.test.web.servlet.client
-
Base specification for configuring
MockMvc
, and a simple facade aroundConfigurableMockMvcBuilder
. - MockPageContext - Class in org.springframework.mock.web
-
Mock implementation of the
PageContext
interface. - MockPageContext() - Constructor for class org.springframework.mock.web.MockPageContext
-
Create new MockPageContext with a default
MockServletContext
,MockHttpServletRequest
,MockHttpServletResponse
,MockServletConfig
. - MockPageContext(ServletContext) - Constructor for class org.springframework.mock.web.MockPageContext
-
Create new MockPageContext with a default
MockHttpServletRequest
,MockHttpServletResponse
,MockServletConfig
. - MockPageContext(ServletContext, HttpServletRequest) - Constructor for class org.springframework.mock.web.MockPageContext
-
Create new MockPageContext with a MockHttpServletResponse, MockServletConfig.
- MockPageContext(ServletContext, HttpServletRequest, HttpServletResponse) - Constructor for class org.springframework.mock.web.MockPageContext
-
Create new MockPageContext with a MockServletConfig.
- MockPageContext(ServletContext, HttpServletRequest, HttpServletResponse, ServletConfig) - Constructor for class org.springframework.mock.web.MockPageContext
-
Create new MockServletConfig.
- MockPart - Class in org.springframework.mock.web
-
Mock implementation of
jakarta.servlet.http.Part
. - MockPart(String, byte[]) - Constructor for class org.springframework.mock.web.MockPart
-
Constructor for a part with a name and content only.
- MockPart(String, String, byte[]) - Constructor for class org.springframework.mock.web.MockPart
-
Constructor for a part with a name, filename, and content.
- MockPart(String, String, byte[], MediaType) - Constructor for class org.springframework.mock.web.MockPart
-
Constructor for a part with a name, filename, content, and content type.
- MockPropertySource - Class in org.springframework.mock.env
-
Simple
PropertySource
implementation for use in testing. - MockPropertySource() - Constructor for class org.springframework.mock.env.MockPropertySource
-
Create a new
MockPropertySource
named "mockProperties" that will maintain its own internalProperties
instance. - MockPropertySource(String) - Constructor for class org.springframework.mock.env.MockPropertySource
-
Create a new
MockPropertySource
with the given name that will maintain its own internalProperties
instance. - MockPropertySource(String, Properties) - Constructor for class org.springframework.mock.env.MockPropertySource
-
Create a new
MockPropertySource
with the given name and backed by the givenProperties
object. - MockPropertySource(Properties) - Constructor for class org.springframework.mock.env.MockPropertySource
- MockRequestDispatcher - Class in org.springframework.mock.web
-
Mock implementation of the
RequestDispatcher
interface. - MockRequestDispatcher(String) - Constructor for class org.springframework.mock.web.MockRequestDispatcher
-
Create a new MockRequestDispatcher for the given resource.
- MockRestRequestMatchers - Class in org.springframework.test.web.client.match
-
Static factory methods for
RequestMatcher
classes. - MockRestRequestMatchers() - Constructor for class org.springframework.test.web.client.match.MockRestRequestMatchers
- MockRestResponseCreators - Class in org.springframework.test.web.client.response
-
Static factory methods to obtain a
ResponseCreator
with a fixed response. - MockRestResponseCreators() - Constructor for class org.springframework.test.web.client.response.MockRestResponseCreators
- MockRestServiceServer - Class in org.springframework.test.web.client
-
Main entry point for client-side REST testing.
- MockRestServiceServer.MockRestServiceServerBuilder - Interface in org.springframework.test.web.client
-
Builder to create a
MockRestServiceServer
. - MockServerClientHttpResponse - Interface in org.springframework.test.web.reactive.server
-
Simple
ClientHttpResponse
extension that also exposes a result object from the underlying mock server exchange for further assertions on the state of the server response after the request is performed. - MockServerConfigurer - Interface in org.springframework.test.web.reactive.server
-
Contract that frameworks or applications can use to pre-package a set of customizations to a
WebTestClient.MockServerSpec
and expose that as a shortcut. - MockServerHttpRequest - Class in org.springframework.mock.http.server.reactive
-
Mock extension of
AbstractServerHttpRequest
for use in tests without an actual server. - MockServerHttpRequest.BaseBuilder<B extends MockServerHttpRequest.BaseBuilder<B>> - Interface in org.springframework.mock.http.server.reactive
-
Request builder exposing properties not related to the body.
- MockServerHttpRequest.BodyBuilder - Interface in org.springframework.mock.http.server.reactive
-
A builder that adds a body to the request.
- MockServerHttpResponse - Class in org.springframework.mock.http.server.reactive
-
Mock extension of
AbstractServerHttpResponse
for use in tests without an actual server. - MockServerHttpResponse() - Constructor for class org.springframework.mock.http.server.reactive.MockServerHttpResponse
- MockServerHttpResponse(DataBufferFactory) - Constructor for class org.springframework.mock.http.server.reactive.MockServerHttpResponse
- MockServerRequest - Class in org.springframework.mock.web.reactive.function.server
-
Mock implementation of
ServerRequest
. - MockServerRequest.Builder - Interface in org.springframework.mock.web.reactive.function.server
-
Builder for
MockServerRequest
. - MockServerWebExchange - Class in org.springframework.mock.web.server
-
Extension of
DefaultServerWebExchange
for use in tests, along withMockServerHttpRequest
andMockServerHttpResponse
. - MockServerWebExchange.Builder - Class in org.springframework.mock.web.server
-
Builder for a
MockServerWebExchange
. - MockServletConfig - Class in org.springframework.mock.web
-
Mock implementation of the
ServletConfig
interface. - MockServletConfig() - Constructor for class org.springframework.mock.web.MockServletConfig
-
Create a new MockServletConfig with a default
MockServletContext
. - MockServletConfig(ServletContext) - Constructor for class org.springframework.mock.web.MockServletConfig
-
Create a new MockServletConfig.
- MockServletConfig(ServletContext, String) - Constructor for class org.springframework.mock.web.MockServletConfig
-
Create a new MockServletConfig.
- MockServletConfig(String) - Constructor for class org.springframework.mock.web.MockServletConfig
-
Create a new MockServletConfig with a default
MockServletContext
. - MockServletContext - Class in org.springframework.mock.web
-
Mock implementation of the
ServletContext
interface. - MockServletContext() - Constructor for class org.springframework.mock.web.MockServletContext
-
Create a new
MockServletContext
, using no base path and aDefaultResourceLoader
(i.e. - MockServletContext(String) - Constructor for class org.springframework.mock.web.MockServletContext
-
Create a new
MockServletContext
, using aDefaultResourceLoader
. - MockServletContext(String, ResourceLoader) - Constructor for class org.springframework.mock.web.MockServletContext
-
Create a new
MockServletContext
using the supplied resource base path and resource loader. - MockServletContext(ResourceLoader) - Constructor for class org.springframework.mock.web.MockServletContext
-
Create a new
MockServletContext
, using the specifiedResourceLoader
and no base path. - MockSessionCookieConfig - Class in org.springframework.mock.web
-
Mock implementation of the
SessionCookieConfig
interface. - MockSessionCookieConfig() - Constructor for class org.springframework.mock.web.MockSessionCookieConfig
- MockWebSession - Class in org.springframework.mock.web.server
-
Implementation of
WebSession
that delegates to a session instance obtained viaInMemoryWebSessionStore
. - MockWebSession() - Constructor for class org.springframework.mock.web.server.MockWebSession
- MockWebSession(Clock) - Constructor for class org.springframework.mock.web.server.MockWebSession
- model() - Static method in class org.springframework.test.web.servlet.result.MockMvcResultMatchers
-
Access to model-related assertions.
- ModelAndViewAssert - Class in org.springframework.test.web
-
A collection of assertions intended to simplify testing scenarios dealing with Spring Web MVC
ModelAndView
objects. - ModelAndViewAssert() - Constructor for class org.springframework.test.web.ModelAndViewAssert
- ModelResultMatchers - Class in org.springframework.test.web.servlet.result
-
Factory for assertions on the model.
- ModelResultMatchers() - Constructor for class org.springframework.test.web.servlet.result.ModelResultMatchers
-
Protected constructor.
- modifyLocations(Class<?>, String...) - Method in class org.springframework.test.context.support.AbstractContextLoader
-
Generate a modified version of the supplied locations array and return it.
- modifyLocations(Class<?>, String...) - Method in class org.springframework.test.context.support.AnnotationConfigContextLoader
-
AnnotationConfigContextLoader
should be used as aSmartContextLoader
, not as a legacyContextLoader
. - modifyLocations(Class<?>, String...) - Method in class org.springframework.test.context.web.AnnotationConfigWebContextLoader
-
AnnotationConfigWebContextLoader
should be used as aSmartContextLoader
, not as a legacyContextLoader
. - modifyWebClient(WebClient) - Method in class org.springframework.test.web.servlet.htmlunit.webdriver.WebConnectionHtmlUnitDriver
-
Modify the supplied
WebClient
and retain a reference to it so that itsWebConnection
is accessible for later use. - modifyWebClientInternal(WebClient) - Method in class org.springframework.test.web.servlet.htmlunit.webdriver.WebConnectionHtmlUnitDriver
-
Modify the supplied
WebClient
. - multipart(String, Object...) - Static method in class org.springframework.test.web.servlet.request.MockMvcRequestBuilders
-
Create a
MockMultipartHttpServletRequestBuilder
for a multipart request, using POST as the HTTP method. - multipart(URI) - Static method in class org.springframework.test.web.servlet.request.MockMvcRequestBuilders
-
Variant of
MockMvcRequestBuilders.multipart(String, Object...)
with aURI
. - multipart(HttpMethod, String, Object...) - Static method in class org.springframework.test.web.servlet.request.MockMvcRequestBuilders
-
Variant of
MockMvcRequestBuilders.multipart(String, Object...)
that also accepts anHttpMethod
. - multipart(HttpMethod, URI) - Static method in class org.springframework.test.web.servlet.request.MockMvcRequestBuilders
- multipartData() - Method in class org.springframework.mock.web.reactive.function.server.MockServerRequest
- multipartData(MultiValueMap<String, ?>) - Method in class org.springframework.test.web.client.match.ContentRequestMatchers
-
Parse the body as multipart data and assert it contains exactly the values from the given
MultiValueMap
. - multipartDataContains(Map<String, ?>) - Method in class org.springframework.test.web.client.match.ContentRequestMatchers
-
Variant of
ContentRequestMatchers.multipartData(MultiValueMap)
that does the same but only for a subset of the actual values. - mutate() - Method in interface org.springframework.test.web.reactive.server.WebTestClient
-
Return a builder to mutate properties of this web test client.
- mutateWith(WebTestClientConfigurer) - Method in interface org.springframework.test.web.reactive.server.WebTestClient
-
Mutate the
WebTestClient
, apply the given configurer, and build a new instance. - MvcResult - Interface in org.springframework.test.web.servlet
-
Provides access to the result of an executed request.
N
- name() - Element in annotation interface org.springframework.test.annotation.IfProfileValue
-
The
name
of the profile value against which to test. - name() - Element in annotation interface org.springframework.test.context.ContextConfiguration
-
The name of the context hierarchy level represented by this configuration.
- name() - Element in annotation interface org.springframework.test.context.junit.jupiter.SpringJUnitConfig
-
Alias for
ContextConfiguration.name()
. - name() - Element in annotation interface org.springframework.test.context.junit.jupiter.web.SpringJUnitWebConfig
-
Alias for
ContextConfiguration.name()
. - name(String) - Method in class org.springframework.test.web.servlet.result.ViewResultMatchers
-
Assert the selected view name.
- name(Matcher<? super String>) - Method in class org.springframework.test.web.servlet.result.ViewResultMatchers
-
Assert the selected view name with the given Hamcrest
Matcher
. - NestedTestConfiguration - Annotation Interface in org.springframework.test.context
-
@NestedTestConfiguration
is a type-level annotation that is used to configure how Spring test configuration annotations are processed within enclosing class hierarchies (i.e., for inner test classes). - NestedTestConfiguration.EnclosingConfiguration - Enum Class in org.springframework.test.context
-
Enumeration of modes that dictate how test configuration from enclosing classes is processed for inner test classes.
- never() - Static method in class org.springframework.test.web.client.ExpectedCount
-
No calls expected at all, i.e.
- newLine() - Method in class org.springframework.mock.web.MockBodyContent
- newLine() - Method in class org.springframework.mock.web.MockJspWriter
- next() - Method in class org.springframework.test.context.TestContextAnnotationUtils.AnnotationDescriptor
-
Find the next
TestContextAnnotationUtils.AnnotationDescriptor
for the specified annotation type in the hierarchy above the root declaring class of this descriptor. - next() - Method in class org.springframework.test.context.TestContextAnnotationUtils.UntypedAnnotationDescriptor
-
Find the next
TestContextAnnotationUtils.UntypedAnnotationDescriptor
for the specified annotation types in the hierarchy above the root declaring class of this descriptor. - node(Matcher<? super Node>) - Method in class org.springframework.test.web.client.match.ContentRequestMatchers
- node(Matcher<? super Node>) - Method in class org.springframework.test.web.client.match.XpathRequestMatchers
-
Apply the XPath and assert it with the given
Matcher<Node>
. - node(Matcher<? super Node>) - Method in class org.springframework.test.web.servlet.result.ContentResultMatchers
- node(Matcher<? super Node>) - Method in class org.springframework.test.web.servlet.result.XpathResultMatchers
- nodeCount(int) - Method in class org.springframework.test.web.client.match.XpathRequestMatchers
-
Apply the XPath and assert the number of nodes found.
- nodeCount(int) - Method in class org.springframework.test.web.reactive.server.XpathAssertions
- nodeCount(int) - Method in class org.springframework.test.web.servlet.result.XpathResultMatchers
-
Evaluate the XPath and assert the number of nodes found.
- nodeCount(Consumer<Integer>) - Method in class org.springframework.test.web.reactive.server.XpathAssertions
-
Consume the count of nodes as result of the XPath evaluation.
- nodeCount(Matcher<? super Integer>) - Method in class org.springframework.test.web.client.match.XpathRequestMatchers
-
Apply the XPath and assert the number of nodes found with the given
Matcher<Integer>
. - nodeCount(Matcher<? super Integer>) - Method in class org.springframework.test.web.reactive.server.XpathAssertions
- nodeCount(Matcher<? super Integer>) - Method in class org.springframework.test.web.servlet.result.XpathResultMatchers
-
Evaluate the XPath and assert the number of nodes found with the given Hamcrest
Matcher
. - nodeList(Matcher<? super NodeList>) - Method in class org.springframework.test.web.servlet.result.XpathResultMatchers
- nullSafeClassName(ContextLoader) - Static method in class org.springframework.test.context.MergedContextConfiguration
-
Generate a null-safe
String
representation of the suppliedContextLoader
based solely on the fully qualified name of the loader or "null" if the supplied loader isnull
. - number(Double) - Method in class org.springframework.test.web.client.match.XpathRequestMatchers
-
Apply the XPath and assert the number value found.
- number(Double) - Method in class org.springframework.test.web.servlet.result.XpathResultMatchers
-
Evaluate the XPath and assert the
Double
value found. - number(Consumer<Double>) - Method in class org.springframework.test.web.reactive.server.XpathAssertions
-
Consume the result of the XPath evaluation as a Double.
- number(Matcher<? super Double>) - Method in class org.springframework.test.web.client.match.XpathRequestMatchers
-
Apply the XPath and assert the number found with the given matcher.
- number(Matcher<? super Double>) - Method in class org.springframework.test.web.reactive.server.XpathAssertions
- number(Matcher<? super Double>) - Method in class org.springframework.test.web.servlet.result.XpathResultMatchers
O
- once() - Static method in class org.springframework.test.web.client.ExpectedCount
-
Exactly once.
- options() - Method in interface org.springframework.test.web.reactive.server.WebTestClient
-
Prepare an HTTP OPTIONS request.
- options(String, Object...) - Static method in class org.springframework.mock.http.server.reactive.MockServerHttpRequest
-
HTTP OPTIONS variant.
- options(String, Object...) - Static method in class org.springframework.test.web.servlet.request.MockMvcRequestBuilders
-
Create a
MockHttpServletRequestBuilder
for an OPTIONS request. - options(URI) - Static method in class org.springframework.test.web.servlet.request.MockMvcRequestBuilders
-
Create a
MockHttpServletRequestBuilder
for an OPTIONS request. - org.springframework.mock.env - package org.springframework.mock.env
-
This package contains mock implementations of the
Environment
andPropertySource
abstractions. - org.springframework.mock.http - package org.springframework.mock.http
-
Mock implementations of client/server-side HTTP abstractions.
- org.springframework.mock.http.client - package org.springframework.mock.http.client
-
Mock implementations of client-side HTTP abstractions.
- org.springframework.mock.http.client.reactive - package org.springframework.mock.http.client.reactive
-
Mock implementations of reactive HTTP client contracts.
- org.springframework.mock.http.server.reactive - package org.springframework.mock.http.server.reactive
-
Mock implementations of reactive HTTP server contracts.
- org.springframework.mock.web - package org.springframework.mock.web
-
A comprehensive set of Servlet API 6.0 mock objects, targeted at usage with Spring's Web MVC framework.
- org.springframework.mock.web.reactive.function.server - package org.springframework.mock.web.reactive.function.server
-
Mock objects for the functional web framework.
- org.springframework.mock.web.server - package org.springframework.mock.web.server
-
Mock implementations of Spring's reactive server web API abstractions.
- org.springframework.test.annotation - package org.springframework.test.annotation
-
Support classes for annotation-driven tests.
- org.springframework.test.context - package org.springframework.test.context
-
This package contains the Spring TestContext Framework which provides annotation-driven unit and integration testing support that is agnostic of the actual testing framework in use.
- org.springframework.test.context.aot - package org.springframework.test.context.aot
-
Ahead-of-time (AOT) support for the Spring TestContext Framework.
- org.springframework.test.context.cache - package org.springframework.test.context.cache
-
Support for context caching within the Spring TestContext Framework.
- org.springframework.test.context.event - package org.springframework.test.context.event
-
Test event support classes for the Spring TestContext Framework.
- org.springframework.test.context.event.annotation - package org.springframework.test.context.event.annotation
-
Test execution event annotations for the Spring TestContext Framework.
- org.springframework.test.context.jdbc - package org.springframework.test.context.jdbc
-
JDBC support classes for the Spring TestContext Framework, including support for declarative SQL script execution via
@Sql
. - org.springframework.test.context.junit.jupiter - package org.springframework.test.context.junit.jupiter
-
Core support for integrating the Spring TestContext Framework with the JUnit Jupiter extension model in JUnit 5.
- org.springframework.test.context.junit.jupiter.web - package org.springframework.test.context.junit.jupiter.web
-
Web support for integrating the Spring TestContext Framework with the JUnit Jupiter extension model in JUnit 5.
- org.springframework.test.context.junit4 - package org.springframework.test.context.junit4
-
Support classes for integrating the Spring TestContext Framework with JUnit 4.12 or higher.
- org.springframework.test.context.junit4.rules - package org.springframework.test.context.junit4.rules
-
Custom JUnit 4
Rules
used in the Spring TestContext Framework. - org.springframework.test.context.junit4.statements - package org.springframework.test.context.junit4.statements
-
Custom JUnit 4
Statements
used in the Spring TestContext Framework. - org.springframework.test.context.support - package org.springframework.test.context.support
-
Support classes for the Spring TestContext Framework.
- org.springframework.test.context.testng - package org.springframework.test.context.testng
-
Support classes for integrating the Spring TestContext Framework with TestNG.
- org.springframework.test.context.transaction - package org.springframework.test.context.transaction
-
Transactional support classes for the Spring TestContext Framework.
- org.springframework.test.context.util - package org.springframework.test.context.util
-
Common utilities used within the Spring TestContext Framework.
- org.springframework.test.context.web - package org.springframework.test.context.web
-
Web support classes for the Spring TestContext Framework.
- org.springframework.test.jdbc - package org.springframework.test.jdbc
-
Support classes for tests based on JDBC.
- org.springframework.test.util - package org.springframework.test.util
-
General utility classes for use in unit and integration tests.
- org.springframework.test.web - package org.springframework.test.web
-
Helper classes for unit tests based on Spring's web support.
- org.springframework.test.web.client - package org.springframework.test.web.client
-
Contains client-side REST testing support.
- org.springframework.test.web.client.match - package org.springframework.test.web.client.match
-
Contains built-in
RequestMatcher
implementations. - org.springframework.test.web.client.response - package org.springframework.test.web.client.response
-
Contains built-in
ResponseCreator
implementations. - org.springframework.test.web.reactive.server - package org.springframework.test.web.reactive.server
-
Support for testing Spring WebFlux server endpoints via
WebTestClient
. - org.springframework.test.web.servlet - package org.springframework.test.web.servlet
-
Contains server-side support for testing Spring MVC applications.
- org.springframework.test.web.servlet.client - package org.springframework.test.web.servlet.client
-
Support for testing Spring MVC applications via
WebTestClient
withMockMvc
for server request handling. - org.springframework.test.web.servlet.htmlunit - package org.springframework.test.web.servlet.htmlunit
-
Server-side support for testing Spring MVC applications with
MockMvc
and HtmlUnit. - org.springframework.test.web.servlet.htmlunit.webdriver - package org.springframework.test.web.servlet.htmlunit.webdriver
-
Server-side support for testing Spring MVC applications with
MockMvc
and the SeleniumHtmlUnitDriver
. - org.springframework.test.web.servlet.request - package org.springframework.test.web.servlet.request
-
Contains built-in
RequestBuilder
implementations. - org.springframework.test.web.servlet.result - package org.springframework.test.web.servlet.result
-
Contains built-in
ResultMatcher
andResultHandler
implementations. - org.springframework.test.web.servlet.setup - package org.springframework.test.web.servlet.setup
-
Contains built-in
MockMvcBuilder
implementations. - OVERRIDE - Enum constant in enum class org.springframework.test.context.jdbc.SqlMergeMode.MergeMode
-
Indicates that method-level
@Sql
declarations should override class-level@Sql
declarations. - OVERRIDE - Enum constant in enum class org.springframework.test.context.NestedTestConfiguration.EnclosingConfiguration
-
Indicates that test configuration for an inner test class should override configuration from its enclosing class.
P
- param(String, String...) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Add a request parameter to
MockHttpServletRequest.getParameterMap()
. - params(MultiValueMap<String, String>) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Variant of
MockHttpServletRequestBuilder.param(String, String...)
with aMultiValueMap
. - parse(String) - Static method in class org.springframework.mock.web.MockCookie
-
Factory method that parses the value of the supplied "Set-Cookie" header.
- parseXmlByteArray(byte[], String) - Method in class org.springframework.test.util.XpathExpectationsHelper
-
Parse the given XML content to a
Document
. - part(Part...) - Method in class org.springframework.test.web.servlet.request.MockMultipartHttpServletRequestBuilder
-
Add
Part
components to the request. - PassThroughFilterChain - Class in org.springframework.mock.web
-
Implementation of the
FilterChain
interface which simply passes the call through to a given Filter/FilterChain combination (indicating the next Filter in the chain along with the FilterChain that it is supposed to work on) or to a given Servlet (indicating the end of the chain). - PassThroughFilterChain(Filter, FilterChain) - Constructor for class org.springframework.mock.web.PassThroughFilterChain
-
Create a new PassThroughFilterChain that delegates to the given Filter, calling it with the given FilterChain.
- PassThroughFilterChain(Servlet) - Constructor for class org.springframework.mock.web.PassThroughFilterChain
-
Create a new PassThroughFilterChain that delegates to the given Servlet.
- patch() - Method in interface org.springframework.test.web.reactive.server.WebTestClient
-
Prepare an HTTP PATCH request.
- patch(String, Object...) - Static method in class org.springframework.mock.http.server.reactive.MockServerHttpRequest
-
HTTP PATCH variant.
- patch(String, Object...) - Static method in class org.springframework.test.web.servlet.request.MockMvcRequestBuilders
-
Create a
MockHttpServletRequestBuilder
for a PATCH request. - patch(URI) - Static method in class org.springframework.test.web.servlet.request.MockMvcRequestBuilders
-
Create a
MockHttpServletRequestBuilder
for a PATCH request. - path(String, String) - Method in class org.springframework.test.web.reactive.server.CookieAssertions
-
Assert a cookie's path attribute.
- path(String, String) - Method in class org.springframework.test.web.servlet.result.CookieResultMatchers
-
Assert a cookie's path.
- path(String, Matcher<? super String>) - Method in class org.springframework.test.web.reactive.server.CookieAssertions
-
Assert a cookie's path attribute with a Hamcrest
Matcher
. - path(String, Matcher<? super String>) - Method in class org.springframework.test.web.servlet.result.CookieResultMatchers
-
Assert a cookie's path with a Hamcrest
Matcher
. - pathInfo(String) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Specify the portion of the requestURI that represents the pathInfo.
- pathMatching(Consumer<PathMatchConfigurer>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.ControllerSpec
-
Configure path matching options.
- pathVariable(String, String) - Method in interface org.springframework.mock.web.reactive.function.server.MockServerRequest.Builder
- pathVariables() - Method in class org.springframework.mock.web.reactive.function.server.MockServerRequest
- pathVariables(Map<String, String>) - Method in interface org.springframework.mock.web.reactive.function.server.MockServerRequest.Builder
- patternParser(PathPatternParser) - Method in interface org.springframework.test.web.servlet.client.MockMvcWebTestClient.ControllerSpec
-
Enable URL path matching with parsed
PathPatterns
. - perform(RequestBuilder) - Method in class org.springframework.test.web.servlet.MockMvc
-
Perform a request and return a type that allows chaining further actions, such as asserting expectations, on the result.
- performAotProcessing() - Method in class org.springframework.test.context.aot.TestAotProcessor
-
Perform ahead-of-time processing of Spring integration test classes.
- placeholderValue(String, String) - Method in interface org.springframework.test.web.servlet.client.MockMvcWebTestClient.ControllerSpec
-
Configure placeholder values to use.
- POPULATED_REQUEST_CONTEXT_HOLDER_ATTRIBUTE - Static variable in class org.springframework.test.context.web.ServletTestExecutionListener
-
Attribute name for a
TestContext
attribute which indicates thatServletTestExecutionListener
has already populated Spring Web'sRequestContextHolder
. - possiblyExpectingExceptions(FrameworkMethod, Object, Statement) - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
-
Perform the same logic as
BlockJUnit4ClassRunner.possiblyExpectingExceptions(FrameworkMethod, Object, Statement)
except that the expected exception is retrieved usingSpringJUnit4ClassRunner.getExpectedException(FrameworkMethod)
. - post() - Method in interface org.springframework.test.web.reactive.server.WebTestClient
-
Prepare an HTTP POST request.
- post(String, Object...) - Static method in class org.springframework.mock.http.server.reactive.MockServerHttpRequest
-
HTTP POST variant.
- post(String, Object...) - Static method in class org.springframework.test.web.servlet.request.MockMvcRequestBuilders
-
Create a
MockHttpServletRequestBuilder
for a POST request. - post(URI) - Static method in class org.springframework.test.web.servlet.request.MockMvcRequestBuilders
-
Create a
MockHttpServletRequestBuilder
for a POST request. - postProcessRequest(MockHttpServletRequest) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
- postProcessRequest(MockHttpServletRequest) - Method in interface org.springframework.test.web.servlet.request.RequestPostProcessor
-
Post-process the given
MockHttpServletRequest
after its creation and initialization through aMockHttpServletRequestBuilder
. - postProcessRequest(MockHttpServletRequest) - Method in interface org.springframework.test.web.servlet.SmartRequestBuilder
-
Apply request post-processing.
- postProcessTestInstance(Object, ExtensionContext) - Method in class org.springframework.test.context.junit.jupiter.SpringExtension
-
Delegates to
TestContextManager.prepareTestInstance(java.lang.Object)
. - prefix(String) - Method in class org.springframework.test.web.servlet.result.JsonPathResultMatchers
-
Configures the current
JsonPathResultMatchers
instance to verify that the JSON payload is prepended with the given prefix. - prepareContext(ConfigurableApplicationContext, MergedContextConfiguration) - Method in class org.springframework.test.context.support.AbstractContextLoader
-
Prepare the
ConfigurableApplicationContext
created by thisSmartContextLoader
before bean definitions are read. - prepareContext(GenericApplicationContext) - Method in class org.springframework.test.context.support.AbstractGenericContextLoader
-
Prepare the
GenericApplicationContext
created by thisContextLoader
. - prepareTestInstance(Object) - Method in class org.springframework.test.context.TestContextManager
-
Hook for preparing a test instance prior to execution of any individual test methods — for example, to inject dependencies.
- prepareTestInstance(TestContext) - Method in class org.springframework.test.context.event.ApplicationEventsTestExecutionListener
- prepareTestInstance(TestContext) - Method in class org.springframework.test.context.event.EventPublishingTestExecutionListener
- prepareTestInstance(TestContext) - Method in class org.springframework.test.context.support.AbstractTestExecutionListener
-
The default implementation is empty.
- prepareTestInstance(TestContext) - Method in class org.springframework.test.context.support.DependencyInjectionTestExecutionListener
-
Performs dependency injection on the
test instance
of the suppliedtest context
byautowiring
andinitializing
the test instance via its ownapplication context
(without checking dependencies). - prepareTestInstance(TestContext) - Method in interface org.springframework.test.context.TestExecutionListener
-
Prepares the test instance of the supplied test context — for example, to inject dependencies.
- prepareTestInstance(TestContext) - Method in class org.springframework.test.context.web.ServletTestExecutionListener
-
Sets up thread-local state during the test instance preparation callback phase via Spring Web's
RequestContextHolder
, but only if the test class is annotated with@WebAppConfiguration
. - PrepareTestInstance - Annotation Interface in org.springframework.test.context.event.annotation
-
@EventListener
annotation used to consume aPrepareTestInstanceEvent
published by theEventPublishingTestExecutionListener
. - PrepareTestInstanceEvent - Class in org.springframework.test.context.event
-
TestContextEvent
published by theEventPublishingTestExecutionListener
whenTestExecutionListener.prepareTestInstance(TestContext)
is invoked. - PrepareTestInstanceEvent(TestContext) - Constructor for class org.springframework.test.context.event.PrepareTestInstanceEvent
- principal() - Method in class org.springframework.mock.web.reactive.function.server.MockServerRequest
- principal(Principal) - Method in interface org.springframework.mock.web.reactive.function.server.MockServerRequest.Builder
- principal(Principal) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Set the principal of the request.
- print() - Static method in class org.springframework.test.web.servlet.result.MockMvcResultHandlers
-
Print
MvcResult
details to the "standard" output stream. - print(boolean) - Method in class org.springframework.mock.web.MockBodyContent
- print(boolean) - Method in class org.springframework.mock.web.MockJspWriter
- print(char) - Method in class org.springframework.mock.web.MockBodyContent
- print(char) - Method in class org.springframework.mock.web.MockJspWriter
- print(char[]) - Method in class org.springframework.mock.web.MockBodyContent
- print(char[]) - Method in class org.springframework.mock.web.MockJspWriter
- print(double) - Method in class org.springframework.mock.web.MockBodyContent
- print(double) - Method in class org.springframework.mock.web.MockJspWriter
- print(float) - Method in class org.springframework.mock.web.MockBodyContent
- print(float) - Method in class org.springframework.mock.web.MockJspWriter
- print(int) - Method in class org.springframework.mock.web.MockBodyContent
- print(int) - Method in class org.springframework.mock.web.MockJspWriter
- print(long) - Method in class org.springframework.mock.web.MockBodyContent
- print(long) - Method in class org.springframework.mock.web.MockJspWriter
- print(OutputStream) - Static method in class org.springframework.test.web.servlet.result.MockMvcResultHandlers
-
Print
MvcResult
details to the suppliedOutputStream
. - print(Writer) - Static method in class org.springframework.test.web.servlet.result.MockMvcResultHandlers
- print(Object) - Method in class org.springframework.mock.web.MockBodyContent
- print(Object) - Method in class org.springframework.mock.web.MockJspWriter
- print(String) - Method in class org.springframework.mock.web.MockBodyContent
- print(String) - Method in class org.springframework.mock.web.MockJspWriter
- printAsyncResult(MvcResult) - Method in class org.springframework.test.web.servlet.result.PrintingResultHandler
- printFlashMap(FlashMap) - Method in class org.springframework.test.web.servlet.result.PrintingResultHandler
-
Print "output" flash attributes.
- printHandler(Object, HandlerInterceptor[]) - Method in class org.springframework.test.web.servlet.result.PrintingResultHandler
-
Print the handler.
- printHeading(String) - Method in interface org.springframework.test.web.servlet.result.PrintingResultHandler.ResultValuePrinter
- PrintingResultHandler - Class in org.springframework.test.web.servlet.result
-
Result handler that prints
MvcResult
details to a given output stream — for example:System.out
,System.err
, a customjava.io.PrintWriter
, etc. - PrintingResultHandler(PrintingResultHandler.ResultValuePrinter) - Constructor for class org.springframework.test.web.servlet.result.PrintingResultHandler
-
Protected constructor.
- PrintingResultHandler.ResultValuePrinter - Interface in org.springframework.test.web.servlet.result
-
A contract for how to actually write result information.
- println() - Method in class org.springframework.mock.web.MockBodyContent
- println() - Method in class org.springframework.mock.web.MockJspWriter
- println(boolean) - Method in class org.springframework.mock.web.MockBodyContent
- println(boolean) - Method in class org.springframework.mock.web.MockJspWriter
- println(char) - Method in class org.springframework.mock.web.MockBodyContent
- println(char) - Method in class org.springframework.mock.web.MockJspWriter
- println(char[]) - Method in class org.springframework.mock.web.MockBodyContent
- println(char[]) - Method in class org.springframework.mock.web.MockJspWriter
- println(double) - Method in class org.springframework.mock.web.MockBodyContent
- println(double) - Method in class org.springframework.mock.web.MockJspWriter
- println(float) - Method in class org.springframework.mock.web.MockBodyContent
- println(float) - Method in class org.springframework.mock.web.MockJspWriter
- println(int) - Method in class org.springframework.mock.web.MockBodyContent
- println(int) - Method in class org.springframework.mock.web.MockJspWriter
- println(long) - Method in class org.springframework.mock.web.MockBodyContent
- println(long) - Method in class org.springframework.mock.web.MockJspWriter
- println(Object) - Method in class org.springframework.mock.web.MockBodyContent
- println(Object) - Method in class org.springframework.mock.web.MockJspWriter
- println(String) - Method in class org.springframework.mock.web.MockBodyContent
- println(String) - Method in class org.springframework.mock.web.MockJspWriter
- printModelAndView(ModelAndView) - Method in class org.springframework.test.web.servlet.result.PrintingResultHandler
-
Print the ModelAndView.
- printRequest(MockHttpServletRequest) - Method in class org.springframework.test.web.servlet.result.PrintingResultHandler
-
Print the request.
- printResolvedException(Exception) - Method in class org.springframework.test.web.servlet.result.PrintingResultHandler
-
Print exceptions resolved through a HandlerExceptionResolver.
- printResponse(MockHttpServletResponse) - Method in class org.springframework.test.web.servlet.result.PrintingResultHandler
-
Print the response.
- printValue(String, Object) - Method in interface org.springframework.test.web.servlet.result.PrintingResultHandler.ResultValuePrinter
- processAheadOfTime(Stream<Class<?>>) - Method in class org.springframework.test.context.aot.TestContextAotGenerator
-
Process each of the supplied Spring integration test classes and generate AOT artifacts.
- processAheadOfTime(RuntimeHints, Class<?>, ClassLoader) - Method in interface org.springframework.test.context.aot.AotTestExecutionListener
-
Process the supplied test class ahead-of-time using the given
RuntimeHints
instance. - processAheadOfTime(RuntimeHints, Class<?>, ClassLoader) - Method in class org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener
-
Process the supplied test class and its methods and register run-time hints for any SQL scripts configured or detected as classpath resources via
@Sql
. - processContextConfiguration(ContextConfigurationAttributes) - Method in interface org.springframework.test.context.SmartContextLoader
-
Process the
ContextConfigurationAttributes
for a given test class. - processContextConfiguration(ContextConfigurationAttributes) - Method in class org.springframework.test.context.support.AbstractContextLoader
-
The default implementation processes locations analogous to
AbstractContextLoader.processLocations(Class, String...)
, using thedeclaring class
as the test class and theresource locations
retrieved from the suppliedconfiguration attributes
as the locations to process. - processContextConfiguration(ContextConfigurationAttributes) - Method in class org.springframework.test.context.support.AbstractDelegatingSmartContextLoader
-
Delegates to candidate
SmartContextLoaders
to process the suppliedContextConfigurationAttributes
. - processContextConfiguration(ContextConfigurationAttributes) - Method in class org.springframework.test.context.support.AnnotationConfigContextLoader
-
Process component classes in the supplied
ContextConfigurationAttributes
. - processContextConfiguration(ContextConfigurationAttributes) - Method in class org.springframework.test.context.web.AnnotationConfigWebContextLoader
-
Process annotated classes in the supplied
ContextConfigurationAttributes
. - processLoadFailure(ApplicationContext, Throwable) - Method in interface org.springframework.test.context.ApplicationContextFailureProcessor
-
Invoked when a failure was encountered while attempting to load an
ApplicationContext
. - processLocations(Class<?>, String...) - Method in interface org.springframework.test.context.ContextLoader
-
Deprecated.as of Spring Framework 6.0, in favor of methods defined in the
SmartContextLoader
SPI - processLocations(Class<?>, String...) - Method in interface org.springframework.test.context.SmartContextLoader
-
SmartContextLoader
does not support deprecatedContextLoader
methods. - processLocations(Class<?>, String...) - Method in class org.springframework.test.context.support.AbstractContextLoader
-
If the supplied
locations
arenull
or empty andAbstractContextLoader.isGenerateDefaultLocations()
returnstrue
, default locations will begenerated
(i.e., detected) for the specifiedclass
and the configured resource suffixes; otherwise, the suppliedlocations
will be modified if necessary and returned. - processMergedContextConfiguration(MergedContextConfiguration) - Method in class org.springframework.test.context.support.AbstractTestContextBootstrapper
-
Process the supplied, newly instantiated
MergedContextConfiguration
instance. - processMergedContextConfiguration(MergedContextConfiguration) - Method in class org.springframework.test.context.web.WebTestContextBootstrapper
-
Returns a
WebMergedContextConfiguration
if the test class in the suppliedMergedContextConfiguration
is annotated with@WebAppConfiguration
and otherwise returns the supplied instance unmodified. - processStrings(String[]) - Static method in class org.springframework.test.context.MergedContextConfiguration
- profiles() - Element in annotation interface org.springframework.test.context.ActiveProfiles
-
The bean definition profiles to activate.
- ProfileValueChecker - Class in org.springframework.test.context.junit4.statements
-
ProfileValueChecker
is a custom JUnitStatement
that checks whether a test class or test method is enabled in the current environment via Spring's@IfProfileValue
annotation. - ProfileValueChecker(Statement, Class<?>, Method) - Constructor for class org.springframework.test.context.junit4.statements.ProfileValueChecker
-
Construct a new
ProfileValueChecker
statement. - ProfileValueSource - Interface in org.springframework.test.annotation
-
Strategy interface for retrieving profile values for a given testing environment.
- ProfileValueSourceConfiguration - Annotation Interface in org.springframework.test.annotation
-
ProfileValueSourceConfiguration
is a class-level annotation for use with JUnit 4 which is used to specify what type ofProfileValueSource
to use when retrieving profile values configured via@IfProfileValue
. - ProfileValueUtils - Class in org.springframework.test.annotation
-
General utility methods for working with profile values.
- ProfileValueUtils() - Constructor for class org.springframework.test.annotation.ProfileValueUtils
- properties() - Element in annotation interface org.springframework.test.context.TestPropertySource
-
Inlined properties in the form of key-value pairs that should be added to the Spring
Environment
before theApplicationContext
is loaded for the test. - PropertyProvider - Interface in org.springframework.test.context.support
-
Strategy for providing named properties — for example, for looking up key-value pairs in a generic fashion.
- publishEvent(Function<TestContext, ? extends ApplicationEvent>) - Method in interface org.springframework.test.context.TestContext
-
Publish the
ApplicationEvent
created by the giveneventFactory
to the application context for this test context. - put() - Method in interface org.springframework.test.web.reactive.server.WebTestClient
-
Prepare an HTTP PUT request.
- put(String, Object...) - Static method in class org.springframework.mock.http.server.reactive.MockServerHttpRequest
-
HTTP PUT variant.
- put(String, Object...) - Static method in class org.springframework.test.web.servlet.request.MockMvcRequestBuilders
-
Create a
MockHttpServletRequestBuilder
for a PUT request. - put(URI) - Static method in class org.springframework.test.web.servlet.request.MockMvcRequestBuilders
-
Create a
MockHttpServletRequestBuilder
for a PUT request. - put(MergedContextConfiguration, ApplicationContext) - Method in interface org.springframework.test.context.cache.ContextCache
-
Explicitly add an
ApplicationContext
instance to the cache under the given key, potentially honoring a custom eviction policy. - put(MergedContextConfiguration, ApplicationContext) - Method in class org.springframework.test.context.cache.DefaultContextCache
Q
- queryParam(String, Object...) - Method in interface org.springframework.mock.http.server.reactive.MockServerHttpRequest.BaseBuilder
-
Append the given query parameter to the existing query parameters.
- queryParam(String, String) - Method in interface org.springframework.mock.web.reactive.function.server.MockServerRequest.Builder
- queryParam(String, String...) - Static method in class org.springframework.test.web.client.match.MockRestRequestMatchers
-
Assert request query parameter values.
- queryParam(String, String...) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Append to the query string and also add to the
request parameters
map. - queryParam(String, Matcher<? super String>...) - Static method in class org.springframework.test.web.client.match.MockRestRequestMatchers
-
Assert request query parameter values with the given Hamcrest matcher(s).
- queryParamList(String, Matcher<? super List<String>>) - Static method in class org.springframework.test.web.client.match.MockRestRequestMatchers
-
Assert request query parameter values with the given Hamcrest matcher, matching on the entire
List
of values. - queryParams() - Method in class org.springframework.mock.web.reactive.function.server.MockServerRequest
- queryParams(MultiValueMap<String, String>) - Method in interface org.springframework.mock.http.server.reactive.MockServerHttpRequest.BaseBuilder
-
Add the given query parameters and values.
- queryParams(MultiValueMap<String, String>) - Method in interface org.springframework.mock.web.reactive.function.server.MockServerRequest.Builder
- queryParams(MultiValueMap<String, String>) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Append to the query string and also add to the
request parameters
map.
R
- range(HttpRange...) - Method in interface org.springframework.mock.http.server.reactive.MockServerHttpRequest.BaseBuilder
-
Set the (new) value of the Range header.
- read() - Method in class org.springframework.mock.web.DelegatingServletInputStream
- reason() - Element in annotation interface org.springframework.test.context.junit.jupiter.DisabledIf
-
The reason this test is disabled.
- reason() - Element in annotation interface org.springframework.test.context.junit.jupiter.EnabledIf
-
The reason this test is enabled.
- reason(String) - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the Servlet response error message.
- reason(Matcher<? super String>) - Method in class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Assert the Servlet response error message with the given Hamcrest
Matcher
. - reasonEquals(String) - Method in class org.springframework.test.web.reactive.server.StatusAssertions
-
Assert the response error message.
- RecordApplicationEvents - Annotation Interface in org.springframework.test.context.event
-
@RecordApplicationEvents
is a class-level annotation that is used to instruct the Spring TestContext Framework to record all application events that are published in theApplicationContext
during the execution of a single test, either from the test thread or its descendants. - redirectedUrl(String) - Static method in class org.springframework.test.web.servlet.result.MockMvcResultMatchers
-
Asserts the request was redirected to the given URL.
- redirectedUrlPattern(String) - Static method in class org.springframework.test.web.servlet.result.MockMvcResultMatchers
-
Asserts the request was redirected to the given URL.
- redirectedUrlTemplate(String, Object...) - Static method in class org.springframework.test.web.servlet.result.MockMvcResultMatchers
-
Asserts the request was redirected to the given URL template.
- ReflectionTestUtils - Class in org.springframework.test.util
-
ReflectionTestUtils
is a collection of reflection-based utility methods for use in unit and integration testing scenarios. - ReflectionTestUtils() - Constructor for class org.springframework.test.util.ReflectionTestUtils
- registerContext(String, ServletContext) - Method in class org.springframework.mock.web.MockServletContext
- registerHints(RuntimeHints, Class<?>, ClassLoader) - Method in interface org.springframework.test.context.aot.TestRuntimeHintsRegistrar
-
Contribute hints to the given
RuntimeHints
instance. - registerNamedDispatcher(String, RequestDispatcher) - Method in class org.springframework.mock.web.MockServletContext
-
Register a
RequestDispatcher
(typically aMockRequestDispatcher
) that acts as a wrapper for the named Servlet. - registerTestExecutionListeners(List<TestExecutionListener>) - Method in class org.springframework.test.context.TestContextManager
-
Register the supplied list of
TestExecutionListeners
by appending them to the list of listeners used by thisTestContextManager
. - registerTestExecutionListeners(TestExecutionListener...) - Method in class org.springframework.test.context.TestContextManager
-
Register the supplied array of
TestExecutionListeners
by appending them to the list of listeners used by thisTestContextManager
. - REINJECT_DEPENDENCIES_ATTRIBUTE - Static variable in class org.springframework.test.context.support.DependencyInjectionTestExecutionListener
-
Attribute name for a
TestContext
attribute which indicates whether the dependencies of a test instance should be reinjected inbeforeTestMethod()
. - release() - Method in class org.springframework.mock.web.MockPageContext
- remoteAddress() - Method in class org.springframework.mock.web.reactive.function.server.MockServerRequest
- remoteAddress(String) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Set the remote address of the request.
- remoteAddress(InetSocketAddress) - Method in interface org.springframework.mock.http.server.reactive.MockServerHttpRequest.BaseBuilder
-
Set the remote address to return.
- remoteAddress(InetSocketAddress) - Method in interface org.springframework.mock.web.reactive.function.server.MockServerRequest.Builder
- remove(MergedContextConfiguration, DirtiesContext.HierarchyMode) - Method in interface org.springframework.test.context.cache.ContextCache
-
Remove the context with the given key from the cache and explicitly close it if it is an instance of
ConfigurableApplicationContext
. - remove(MergedContextConfiguration, DirtiesContext.HierarchyMode) - Method in class org.springframework.test.context.cache.DefaultContextCache
- removeAllParameters() - Method in class org.springframework.mock.web.MockHttpServletRequest
-
Remove all existing parameters.
- removeAttribute(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
- removeAttribute(String) - Method in class org.springframework.mock.web.MockHttpSession
- removeAttribute(String) - Method in class org.springframework.mock.web.MockPageContext
- removeAttribute(String) - Method in class org.springframework.mock.web.MockServletContext
- removeAttribute(String) - Method in interface org.springframework.test.context.aot.AotTestAttributes
-
Remove the attribute stored under the provided name.
- removeAttribute(String) - Method in class org.springframework.test.context.support.DefaultTestContext
- removeAttribute(String, int) - Method in class org.springframework.mock.web.MockPageContext
- removeHeader(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
-
Remove already registered entries for the specified HTTP header, if any.
- removeParameter(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
-
Remove already registered values for the specified HTTP parameter, if any.
- Repeat - Annotation Interface in org.springframework.test.annotation
-
Test annotation for use with JUnit 4 to indicate that a test method should be invoked repeatedly.
- REPLACE_DEFAULTS - Enum constant in enum class org.springframework.test.context.ContextCustomizerFactories.MergeMode
-
Indicates that locally declared factories should replace the default factories.
- REPLACE_DEFAULTS - Enum constant in enum class org.springframework.test.context.TestExecutionListeners.MergeMode
-
Indicates that locally declared listeners should replace the default listeners.
- request() - Static method in class org.springframework.test.web.servlet.result.MockMvcResultMatchers
-
Access to request-related assertions.
- request(String, URI) - Static method in class org.springframework.test.web.servlet.request.MockMvcRequestBuilders
-
Alternative factory method that allows for custom HTTP verbs (e.g.
- request(HttpMethod, String, Object...) - Static method in class org.springframework.test.web.servlet.request.MockMvcRequestBuilders
-
Create a
MockHttpServletRequestBuilder
for a request with the given HTTP method. - request(HttpMethod, URI) - Static method in class org.springframework.test.web.servlet.request.MockMvcRequestBuilders
-
Create a
MockHttpServletRequestBuilder
for a request with the given HTTP method. - requestAttr(String, Object) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Set a request attribute.
- RequestBuilder - Interface in org.springframework.test.web.servlet
-
Builds a
MockHttpServletRequest
. - RequestCount(ExpectedCount) - Constructor for class org.springframework.test.web.client.DefaultRequestExpectation.RequestCount
- RequestExpectation - Interface in org.springframework.test.web.client
-
An extension of
ResponseActions
that also implementsRequestMatcher
andResponseCreator
- RequestExpectationGroup() - Constructor for class org.springframework.test.web.client.AbstractRequestExpectationManager.RequestExpectationGroup
- RequestExpectationManager - Interface in org.springframework.test.web.client
-
Encapsulates the behavior required to implement
MockRestServiceServer
including its public API (create expectations + verify/reset) along with an extra method for verifying actual requests. - RequestMatcher - Interface in org.springframework.test.web.client
-
A contract for matching requests to expectations.
- requestPath() - Method in class org.springframework.mock.web.reactive.function.server.MockServerRequest
- RequestPostProcessor - Interface in org.springframework.test.web.servlet.request
-
Extension point for applications or 3rd party libraries that wish to further initialize a
MockHttpServletRequest
instance after it has been built byMockHttpServletRequestBuilder
or its subclassMockMultipartHttpServletRequestBuilder
. - RequestResultMatchers - Class in org.springframework.test.web.servlet.result
-
Factory for assertions on the request.
- RequestResultMatchers() - Constructor for class org.springframework.test.web.servlet.result.RequestResultMatchers
-
Protected constructor.
- requestTo(String) - Static method in class org.springframework.test.web.client.match.MockRestRequestMatchers
-
Assert the request URI matches the given string.
- requestTo(URI) - Static method in class org.springframework.test.web.client.match.MockRestRequestMatchers
-
Expect a request to the given URI.
- requestTo(Matcher<? super String>) - Static method in class org.springframework.test.web.client.match.MockRestRequestMatchers
-
Assert the request URI string with the given Hamcrest matcher.
- requestToUriTemplate(String, Object...) - Static method in class org.springframework.test.web.client.match.MockRestRequestMatchers
-
Variant of
MockRestRequestMatchers.requestTo(URI)
that prepares the URI from a URI template plus optional variables viaUriComponentsBuilder
including encoding. - reset() - Method in class org.springframework.mock.web.MockFilterChain
-
Reset this
MockFilterChain
allowing it to be invoked again. - reset() - Method in class org.springframework.mock.web.MockHttpServletResponse
- reset() - Method in interface org.springframework.test.context.cache.ContextCache
-
Reset all state maintained by this cache including statistics.
- reset() - Method in class org.springframework.test.context.cache.DefaultContextCache
- reset() - Method in class org.springframework.test.web.client.AbstractRequestExpectationManager.RequestExpectationGroup
-
Reset all expectations for this group.
- reset() - Method in class org.springframework.test.web.client.AbstractRequestExpectationManager
- reset() - Method in class org.springframework.test.web.client.MockRestServiceServer
-
Reset the internal state removing all expectations and recorded requests.
- reset() - Method in interface org.springframework.test.web.client.RequestExpectationManager
-
Reset the internal state removing all expectations and recorded requests.
- reset() - Method in class org.springframework.test.web.client.SimpleRequestExpectationManager
- reset() - Method in class org.springframework.test.web.client.UnorderedRequestExpectationManager
- RESET_REQUEST_CONTEXT_HOLDER_ATTRIBUTE - Static variable in class org.springframework.test.context.web.ServletTestExecutionListener
-
Attribute name for a
TestContext
attribute which indicates whether theServletTestExecutionListener
should reset Spring Web'sRequestContextHolder
inServletTestExecutionListener.afterTestMethod(TestContext)
. - resetBuffer() - Method in class org.springframework.mock.web.MockHttpServletResponse
- resolve(Class<?>) - Method in interface org.springframework.test.context.ActiveProfilesResolver
-
Resolve the bean definition profiles to use when loading an
ApplicationContext
for the given test class. - resolve(Class<?>) - Method in class org.springframework.test.context.support.DefaultActiveProfilesResolver
-
Resolve the bean definition profiles for the given test class based on profiles configured declaratively via
ActiveProfiles.profiles()
orActiveProfiles.value()
. - resolveContextLoader(Class<?>, List<ContextConfigurationAttributes>) - Method in class org.springframework.test.context.support.AbstractTestContextBootstrapper
-
Resolve the
ContextLoader
class to use for the supplied list ofContextConfigurationAttributes
and then instantiate and return thatContextLoader
. - resolveExplicitContextLoaderClass(List<ContextConfigurationAttributes>) - Method in class org.springframework.test.context.support.AbstractTestContextBootstrapper
- resolveParameter(ParameterContext, ExtensionContext) - Method in class org.springframework.test.context.junit.jupiter.SpringExtension
-
Resolve a value for the
Parameter
in the suppliedParameterContext
by retrieving the corresponding dependency from the test'sApplicationContext
. - resolver() - Element in annotation interface org.springframework.test.context.ActiveProfiles
-
The type of
ActiveProfilesResolver
to use for resolving the active bean definition profiles programmatically. - resolveTestContextBootstrapper(Class<?>) - Static method in class org.springframework.test.context.BootstrapUtils
-
Resolve the
TestContextBootstrapper
type for the supplied test class using the defaultBootstrapContext
, instantiate the bootstrapper, and provide it a reference to theBootstrapContext
. - resourcePath() - Element in annotation interface org.springframework.test.context.junit.jupiter.web.SpringJUnitWebConfig
-
Alias for
WebAppConfiguration.value()
. - ResponseActions - Interface in org.springframework.test.web.client
-
A contract for setting up request expectations and defining a response.
- ResponseCreator - Interface in org.springframework.test.web.client
-
A contract for creating a
ClientHttpResponse
. - responseTimeout(Duration) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.Builder
-
Max amount of time to wait for responses.
- ResultActions - Interface in org.springframework.test.web.servlet
-
Allows applying actions, such as expectations, on the result of an executed request.
- resultActionsFor(ExchangeResult) - Static method in interface org.springframework.test.web.servlet.client.MockMvcWebTestClient
-
This method can be used to apply further assertions on a given
ExchangeResult
based the state of the server response. - ResultHandler - Interface in org.springframework.test.web.servlet
-
A
ResultHandler
performs a generic action on the result of an executed request — for example, printing debug information. - ResultMatcher - Interface in org.springframework.test.web.servlet
-
A
ResultMatcher
matches the result of an executed request against some expectation. - retrieveContextFailureThreshold() - Static method in class org.springframework.test.context.cache.ContextCacheUtils
-
Retrieve the failure threshold for application context loading.
- retrieveDataSource(TestContext, String) - Static method in class org.springframework.test.context.transaction.TestContextTransactionUtils
-
Retrieve the
DataSource
to use for the supplied test context. - retrieveMaxCacheSize() - Static method in class org.springframework.test.context.cache.ContextCacheUtils
-
Retrieve the maximum size of the
ContextCache
. - retrieveProfileValueSource(Class<?>) - Static method in class org.springframework.test.annotation.ProfileValueUtils
-
Retrieves the
ProfileValueSource
type for the specifiedtest class
as configured via the@ProfileValueSourceConfiguration
annotation and instantiates a new instance of that type. - retrieveTransactionManager(TestContext, String) - Static method in class org.springframework.test.context.transaction.TestContextTransactionUtils
-
Retrieve the transaction manager to use for the supplied test context.
- returnResult() - Method in interface org.springframework.test.web.reactive.server.WebTestClient.BodyContentSpec
-
Exit the chained API and return an
ExchangeResult
with the raw response content. - returnResult() - Method in interface org.springframework.test.web.reactive.server.WebTestClient.BodySpec
-
Exit the chained API and return an
ExchangeResult
with the decoded response content. - returnResult(Class<T>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.ResponseSpec
-
Exit the chained flow in order to consume the response body externally, e.g.
- returnResult(ParameterizedTypeReference<T>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.ResponseSpec
-
Alternative to
WebTestClient.ResponseSpec.returnResult(Class)
that accepts information about a target type with generics. - Rollback - Annotation Interface in org.springframework.test.annotation
-
@Rollback
is a test annotation that is used to indicate whether a test-managed transaction should be rolled back after the test method has completed. - run(RunNotifier) - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
-
Check whether the test is enabled in the current execution environment.
- run(IHookCallBack, ITestResult) - Method in class org.springframework.test.context.testng.AbstractTestNGSpringContextTests
-
Delegates to the test method in the supplied
callback
to execute the actual test and then tracks the exception thrown during test execution, if any. - RunAfterTestClassCallbacks - Class in org.springframework.test.context.junit4.statements
-
RunAfterTestClassCallbacks
is a custom JUnitStatement
which allows the Spring TestContext Framework to be plugged into the JUnit execution chain by callingafterTestClass()
on the suppliedTestContextManager
. - RunAfterTestClassCallbacks(Statement, TestContextManager) - Constructor for class org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks
-
Construct a new
RunAfterTestClassCallbacks
statement. - RunAfterTestExecutionCallbacks - Class in org.springframework.test.context.junit4.statements
-
RunAfterTestExecutionCallbacks
is a custom JUnitStatement
which allows the Spring TestContext Framework to be plugged into the JUnit 4 execution chain by callingafterTestExecution()
on the suppliedTestContextManager
. - RunAfterTestExecutionCallbacks(Statement, Object, Method, TestContextManager) - Constructor for class org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks
-
Construct a new
RunAfterTestExecutionCallbacks
statement. - RunAfterTestMethodCallbacks - Class in org.springframework.test.context.junit4.statements
-
RunAfterTestMethodCallbacks
is a custom JUnitStatement
which allows the Spring TestContext Framework to be plugged into the JUnit execution chain by callingafterTestMethod()
on the suppliedTestContextManager
. - RunAfterTestMethodCallbacks(Statement, Object, Method, TestContextManager) - Constructor for class org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks
-
Construct a new
RunAfterTestMethodCallbacks
statement. - runAfterTransactionMethods(TestContext) - Method in class org.springframework.test.context.transaction.TransactionalTestExecutionListener
-
Run all
@AfterTransaction
methods for the specified test context. - RunBeforeTestClassCallbacks - Class in org.springframework.test.context.junit4.statements
-
RunBeforeTestClassCallbacks
is a custom JUnitStatement
which allows the Spring TestContext Framework to be plugged into the JUnit execution chain by callingbeforeTestClass()
on the suppliedTestContextManager
. - RunBeforeTestClassCallbacks(Statement, TestContextManager) - Constructor for class org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks
-
Construct a new
RunBeforeTestClassCallbacks
statement. - RunBeforeTestExecutionCallbacks - Class in org.springframework.test.context.junit4.statements
-
RunBeforeTestExecutionCallbacks
is a custom JUnitStatement
which allows the Spring TestContext Framework to be plugged into the JUnit 4 execution chain by callingbeforeTestExecution()
on the suppliedTestContextManager
. - RunBeforeTestExecutionCallbacks(Statement, Object, Method, TestContextManager) - Constructor for class org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks
-
Construct a new
RunBeforeTestExecutionCallbacks
statement. - RunBeforeTestMethodCallbacks - Class in org.springframework.test.context.junit4.statements
-
RunBeforeTestMethodCallbacks
is a custom JUnitStatement
which allows the Spring TestContext Framework to be plugged into the JUnit execution chain by callingbeforeTestMethod()
on the suppliedTestContextManager
. - RunBeforeTestMethodCallbacks(Statement, Object, Method, TestContextManager) - Constructor for class org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks
-
Construct a new
RunBeforeTestMethodCallbacks
statement. - runBeforeTransactionMethods(TestContext) - Method in class org.springframework.test.context.transaction.TransactionalTestExecutionListener
-
Run all
@BeforeTransaction
methods for the specified test context. - runChild(FrameworkMethod, RunNotifier) - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
-
Perform the same logic as
BlockJUnit4ClassRunner.runChild(FrameworkMethod, RunNotifier)
, except that tests are determined to be ignored bySpringJUnit4ClassRunner.isTestMethodIgnored(FrameworkMethod)
. - RunPrepareTestInstanceCallbacks - Class in org.springframework.test.context.junit4.statements
-
RunPrepareTestInstanceCallbacks
is a custom JUnitStatement
which allows the Spring TestContext Framework to be plugged into the JUnit execution chain by callingprepareTestInstance()
on the suppliedTestContextManager
. - RunPrepareTestInstanceCallbacks(Statement, Object, TestContextManager) - Constructor for class org.springframework.test.context.junit4.statements.RunPrepareTestInstanceCallbacks
-
Construct a new
RunPrepareTestInstanceCallbacks
statement.
S
- sameSite(String, String) - Method in class org.springframework.test.web.reactive.server.CookieAssertions
-
Assert a cookie's sameSite attribute.
- sameSite(String, String) - Method in class org.springframework.test.web.servlet.result.CookieResultMatchers
-
Assert a cookie's SameSite attribute.
- sameSite(String, Matcher<? super String>) - Method in class org.springframework.test.web.servlet.result.CookieResultMatchers
-
Assert a cookie's SameSite attribute with a Hamcrest
Matcher
. - save() - Method in class org.springframework.mock.web.server.MockWebSession
- scanClasspathRoots() - Method in class org.springframework.test.context.aot.TestAotProcessor
-
Scan the configured classpath roots for Spring integration test classes.
- scripts() - Element in annotation interface org.springframework.test.context.jdbc.Sql
-
The paths to the SQL scripts to execute.
- searchEnclosingClass(Class<?>) - Static method in class org.springframework.test.context.TestContextAnnotationUtils
-
Determine if annotations on the enclosing class of the supplied class should be searched by annotation search algorithms within the Spring TestContext Framework.
- secure(boolean) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Set the secure property of the
ServletRequest
indicating use of a secure channel, such as HTTPS. - secure(String, boolean) - Method in class org.springframework.test.web.reactive.server.CookieAssertions
-
Assert a cookie's secure attribute.
- secure(String, boolean) - Method in class org.springframework.test.web.servlet.result.CookieResultMatchers
-
Assert whether the cookie must be sent over a secure protocol or not.
- self() - Method in class org.springframework.test.web.servlet.setup.AbstractMockMvcBuilder
- sendError(int) - Method in class org.springframework.mock.web.MockHttpServletResponse
- sendError(int, String) - Method in class org.springframework.mock.web.MockHttpServletResponse
- sendRedirect(String) - Method in class org.springframework.mock.web.MockHttpServletResponse
- separator() - Element in annotation interface org.springframework.test.context.jdbc.SqlConfig
-
The character string used to separate individual statements within the SQL scripts.
- serializeState() - Method in class org.springframework.mock.web.MockHttpSession
-
Serialize the attributes of this session into an object that can be turned into a byte array with standard Java serialization.
- servletPath(String) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Specify the portion of the requestURI that represents the path to which the Servlet is mapped.
- ServletTestExecutionListener - Class in org.springframework.test.context.web
-
TestExecutionListener
which provides mock Servlet API support toWebApplicationContexts
loaded by the Spring TestContext Framework. - ServletTestExecutionListener() - Constructor for class org.springframework.test.context.web.ServletTestExecutionListener
- session() - Method in class org.springframework.mock.web.reactive.function.server.MockServerRequest
- session(MockHttpSession) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Set the HTTP session to use, possibly re-used across requests.
- session(WebSession) - Method in interface org.springframework.mock.web.reactive.function.server.MockServerRequest.Builder
- session(WebSession) - Method in class org.springframework.mock.web.server.MockServerWebExchange.Builder
-
Set the session to use for the exchange.
- SESSION_COOKIE_NAME - Static variable in class org.springframework.mock.web.MockHttpSession
-
The session cookie name.
- sessionAttr(String, Object) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Set a session attribute.
- sessionAttribute(String, Object) - Method in class org.springframework.test.web.servlet.result.RequestResultMatchers
-
Assert a session attribute value.
- sessionAttribute(String, Matcher<? super T>) - Method in class org.springframework.test.web.servlet.result.RequestResultMatchers
-
Assert a session attribute value with the given Hamcrest
Matcher
. - sessionAttributeDoesNotExist(String...) - Method in class org.springframework.test.web.servlet.result.RequestResultMatchers
-
Assert the given session attributes do not exist.
- sessionAttrs(Map<String, Object>) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
Set session attributes.
- sessionManager(WebSessionManager) - Method in class org.springframework.mock.web.server.MockServerWebExchange.Builder
-
Provide a
WebSessionManager
instance to use with the exchange. - setApplicationContext(ApplicationContext) - Method in class org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests
-
Set the
ApplicationContext
to be used by this test instance, provided viaApplicationContextAware
semantics. - setApplicationContext(ApplicationContext) - Method in class org.springframework.test.context.testng.AbstractTestNGSpringContextTests
-
Set the
ApplicationContext
to be used by this test instance, provided viaApplicationContextAware
semantics. - setAsyncContext(MockAsyncContext) - Method in class org.springframework.mock.web.MockHttpServletRequest
- setAsyncRequestTimeout(long) - Method in class org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder
-
Specify the timeout value for async execution.
- setAsyncStarted(boolean) - Method in class org.springframework.mock.web.MockHttpServletRequest
- setAsyncSupported(boolean) - Method in class org.springframework.mock.web.MockHttpServletRequest
- setAttribute(String, boolean) - Method in interface org.springframework.test.context.aot.AotTestAttributes
-
Set a
boolean
attribute for later retrieval during AOT run-time execution. - setAttribute(String, Object) - Method in class org.springframework.mock.web.MockHttpServletRequest
- setAttribute(String, Object) - Method in class org.springframework.mock.web.MockHttpSession
- setAttribute(String, Object) - Method in class org.springframework.mock.web.MockPageContext
- setAttribute(String, Object) - Method in class org.springframework.mock.web.MockServletContext
- setAttribute(String, Object) - Method in class org.springframework.test.context.support.DefaultTestContext
- setAttribute(String, Object, int) - Method in class org.springframework.mock.web.MockPageContext
- setAttribute(String, String) - Method in class org.springframework.mock.web.MockCookie
- setAttribute(String, String) - Method in class org.springframework.mock.web.MockSessionCookieConfig
- setAttribute(String, String) - Method in interface org.springframework.test.context.aot.AotTestAttributes
-
Set a
String
attribute for later retrieval during AOT run-time execution. - setAuthType(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
- setBody(String) - Method in class org.springframework.mock.http.client.reactive.MockClientHttpResponse
- setBody(String, Charset) - Method in class org.springframework.mock.http.client.reactive.MockClientHttpResponse
- setBody(Publisher<DataBuffer>) - Method in class org.springframework.mock.http.client.reactive.MockClientHttpResponse
- setBootstrapContext(BootstrapContext) - Method in class org.springframework.test.context.support.AbstractTestContextBootstrapper
- setBootstrapContext(BootstrapContext) - Method in interface org.springframework.test.context.TestContextBootstrapper
-
Set the
BootstrapContext
to be used by this bootstrapper. - setBufferSize(int) - Method in class org.springframework.mock.web.MockHttpServletResponse
- setCharacterEncoding(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
- setCharacterEncoding(String) - Method in class org.springframework.mock.web.MockHttpServletResponse
- setClasses(Class<?>...) - Method in class org.springframework.test.context.ContextConfigurationAttributes
-
Set the processed annotated classes, effectively overriding the original value declared via
@ContextConfiguration
. - setComment(String) - Method in class org.springframework.mock.web.MockSessionCookieConfig
- setCommitted(boolean) - Method in class org.springframework.mock.web.MockHttpServletResponse
- setComplete() - Method in class org.springframework.mock.http.client.reactive.MockClientHttpRequest
- setComplete() - Method in class org.springframework.mock.http.server.reactive.MockServerHttpResponse
- setContent(byte[]) - Method in class org.springframework.mock.web.MockHttpServletRequest
-
Set the content of the request body as a byte array.
- setContentLength(int) - Method in class org.springframework.mock.web.MockHttpServletResponse
- setContentLengthLong(long) - Method in class org.springframework.mock.web.MockHttpServletResponse
- setContentNegotiationManager(ContentNegotiationManager) - Method in class org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder
-
Set a ContentNegotiationManager.
- setContentType(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
- setContentType(String) - Method in class org.springframework.mock.web.MockHttpServletResponse
- setContextPath(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
- setContextPath(String) - Method in class org.springframework.mock.web.MockServletContext
- setControllerAdvice(Object...) - Method in class org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder
-
Register one or more
ControllerAdvice
instances to be used in tests (specifiedClass
will be turned into instance). - setConversionService(FormattingConversionService) - Method in class org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder
-
Provide a conversion service with custom formatters and converters.
- setCookies(Cookie...) - Method in class org.springframework.mock.web.MockHttpServletRequest
- setCustomArgumentResolvers(HandlerMethodArgumentResolver...) - Method in class org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder
-
Provide custom resolvers for controller method arguments.
- setCustomHandlerMapping(Supplier<RequestMappingHandlerMapping>) - Method in class org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder
-
Configure factory to create a custom
RequestMappingHandlerMapping
. - setCustomReturnValueHandlers(HandlerMethodReturnValueHandler...) - Method in class org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder
-
Provide custom handlers for controller method return values.
- setDataSource(DataSource) - Method in class org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests
-
Set the
DataSource
, typically provided via Dependency Injection. - setDataSource(DataSource) - Method in class org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests
-
Set the
DataSource
, typically provided via Dependency Injection. - setDateHeader(String, long) - Method in class org.springframework.mock.web.MockHttpServletResponse
- setDefaultCharacterEncoding(String) - Method in class org.springframework.mock.web.MockHttpServletResponse
-
Set the default character encoding for the response.
- setDefaultServletName(String) - Method in class org.springframework.mock.web.MockServletContext
-
Set the name of the default
Servlet
. - setDispatcherType(DispatcherType) - Method in class org.springframework.mock.web.MockHttpServletRequest
- setDomain(String) - Method in class org.springframework.mock.web.MockSessionCookieConfig
- setEffectiveMajorVersion(int) - Method in class org.springframework.mock.web.MockServletContext
- setEffectiveMinorVersion(int) - Method in class org.springframework.mock.web.MockServletContext
- setExpires(ZonedDateTime) - Method in class org.springframework.mock.web.MockCookie
-
Set the "Expires" attribute for this cookie.
- setField(Class<?>, String, Object) - Static method in class org.springframework.test.util.ReflectionTestUtils
- setField(Class<?>, String, Object, Class<?>) - Static method in class org.springframework.test.util.ReflectionTestUtils
- setField(Object, Class<?>, String, Object, Class<?>) - Static method in class org.springframework.test.util.ReflectionTestUtils
-
Set the field with the given
name
/type
on the providedtargetObject
/targetClass
to the suppliedvalue
. - setField(Object, String, Object) - Static method in class org.springframework.test.util.ReflectionTestUtils
- setField(Object, String, Object, Class<?>) - Static method in class org.springframework.test.util.ReflectionTestUtils
- setFlashMapManager(FlashMapManager) - Method in class org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder
-
Provide a custom FlashMapManager instance.
- setForwardedUrl(String) - Method in class org.springframework.mock.web.MockHttpServletResponse
- setHandlerExceptionResolvers(List<HandlerExceptionResolver>) - Method in class org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder
-
Set the HandlerExceptionResolver types to use as a list.
- setHandlerExceptionResolvers(HandlerExceptionResolver...) - Method in class org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder
-
Set the HandlerExceptionResolver types to use as an array.
- setHeader(String, String) - Method in class org.springframework.mock.web.MockHttpServletResponse
- setHttpOnly(boolean) - Method in class org.springframework.mock.web.MockSessionCookieConfig
- setHttpServletMapping(HttpServletMapping) - Method in class org.springframework.mock.web.MockHttpServletRequest
- setIncludedUrl(String) - Method in class org.springframework.mock.web.MockHttpServletResponse
- setInitParameter(String, String) - Method in class org.springframework.mock.web.MockServletContext
- setIntHeader(String, int) - Method in class org.springframework.mock.web.MockHttpServletResponse
- setLocalAddr(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
- setLocale(Locale) - Method in class org.springframework.mock.web.MockHttpServletResponse
- setLocaleResolver(LocaleResolver) - Method in class org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder
-
Provide a LocaleResolver instance.
- setLocalName(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
- setLocalPort(int) - Method in class org.springframework.mock.web.MockHttpServletRequest
- setLocations(String...) - Method in class org.springframework.test.context.ContextConfigurationAttributes
-
Set the processed resource locations, effectively overriding the original value declared via
@ContextConfiguration
. - setMajorVersion(int) - Method in class org.springframework.mock.web.MockServletContext
- setMaxAge(int) - Method in class org.springframework.mock.web.MockSessionCookieConfig
- setMaxIdleTime(Duration) - Method in class org.springframework.mock.web.server.MockWebSession
- setMaxInactiveInterval(int) - Method in class org.springframework.mock.web.MockHttpSession
- setMessageConverters(HttpMessageConverter<?>...) - Method in class org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder
-
Set the message converters to use in argument resolvers and in return value handlers, which support reading and/or writing to the body of the request and response.
- setMethod(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
- setMethod(HttpMethod) - Method in class org.springframework.mock.http.client.MockClientHttpRequest
-
Set the HTTP method of the request.
- setMethodInvoker(MethodInvoker) - Method in class org.springframework.test.context.support.DefaultTestContext
- setMethodInvoker(MethodInvoker) - Method in interface org.springframework.test.context.TestContext
-
Set the
MethodInvoker
to use. - setMinorVersion(int) - Method in class org.springframework.mock.web.MockServletContext
- setName(String) - Method in class org.springframework.mock.web.MockSessionCookieConfig
- setNew(boolean) - Method in class org.springframework.mock.web.MockHttpSession
- setOutputStreamAccessAllowed(boolean) - Method in class org.springframework.mock.web.MockHttpServletResponse
-
Set whether
MockHttpServletResponse.getOutputStream()
access is allowed. - setParameter(String, String) - Method in class org.springframework.mock.web.MockHttpServletRequest
-
Set a single value for the specified HTTP parameter.
- setParameter(String, String...) - Method in class org.springframework.mock.web.MockHttpServletRequest
-
Set an array of values for the specified HTTP parameter.
- setParameters(Map<String, ?>) - Method in class org.springframework.mock.web.MockHttpServletRequest
-
Set all provided parameters replacing any existing values for the provided parameter names.
- setPath(String) - Method in class org.springframework.mock.web.MockSessionCookieConfig
- setPathInfo(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
- setPatternParser(PathPatternParser) - Method in class org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder
-
Enable URL path matching with parsed
PathPatterns
instead of String pattern matching with aPathMatcher
. - setPreferredLocales(List<Locale>) - Method in class org.springframework.mock.web.MockHttpServletRequest
-
Set the list of preferred locales, in descending order, effectively replacing any existing locales.
- setProperty(String, Object) - Method in class org.springframework.mock.env.MockPropertySource
-
Set the given property on the underlying
Properties
object. - setProperty(String, String) - Method in class org.springframework.mock.env.MockEnvironment
-
Set a property on the underlying
MockPropertySource
for this environment. - setProtocol(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
- setQueryString(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
- setReadListener(ReadListener) - Method in class org.springframework.mock.web.DelegatingServletInputStream
- setRemoteAddr(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
- setRemoteHost(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
- setRemotePort(int) - Method in class org.springframework.mock.web.MockHttpServletRequest
- setRemoteUser(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
- setRemoveSemicolonContent(boolean) - Method in class org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder
-
Set if ";" (semicolon) content should be stripped from the request URI.
- setRequestCharacterEncoding(String) - Method in class org.springframework.mock.web.MockServletContext
- setRequestedSessionId(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
- setRequestedSessionIdFromCookie(boolean) - Method in class org.springframework.mock.web.MockHttpServletRequest
- setRequestedSessionIdFromURL(boolean) - Method in class org.springframework.mock.web.MockHttpServletRequest
- setRequestedSessionIdValid(boolean) - Method in class org.springframework.mock.web.MockHttpServletRequest
- setRequestURI(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
- setResponse(ClientHttpResponse) - Method in class org.springframework.mock.http.client.MockClientHttpRequest
-
Set the
ClientHttpResponse
to be used as the result of executing the this request. - setResponseCharacterEncoding(String) - Method in class org.springframework.mock.web.MockServletContext
- setSameSite(String) - Method in class org.springframework.mock.web.MockCookie
-
Set the "SameSite" attribute for this cookie.
- setScheme(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
- setSecure(boolean) - Method in class org.springframework.mock.web.MockHttpServletRequest
-
Set the boolean
secure
flag indicating whether the mock request was made using a secure channel, such as HTTPS. - setSecure(boolean) - Method in class org.springframework.mock.web.MockSessionCookieConfig
- setServerName(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
- setServerPort(int) - Method in class org.springframework.mock.web.MockHttpServletRequest
- setServletContextName(String) - Method in class org.springframework.mock.web.MockServletContext
- setServletPath(String) - Method in class org.springframework.mock.web.MockHttpServletRequest
- setSession(HttpSession) - Method in class org.springframework.mock.web.MockHttpServletRequest
- setSessionTimeout(int) - Method in class org.springframework.mock.web.MockServletContext
- setSessionTrackingModes(Set<SessionTrackingMode>) - Method in class org.springframework.mock.web.MockServletContext
- setSingleView(View) - Method in class org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder
-
Sets up a single
ViewResolver
that always returns the provided view instance. - setSqlScriptEncoding(String) - Method in class org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests
-
Specify the encoding for SQL scripts, if different from the platform encoding.
- setSqlScriptEncoding(String) - Method in class org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests
-
Specify the encoding for SQL scripts, if different from the platform encoding.
- setStatus(int) - Method in class org.springframework.mock.web.MockHttpServletResponse
- setTimeout(long) - Method in class org.springframework.mock.web.MockAsyncContext
-
By default this is set to 10000 (10 seconds) even though the Servlet API specifies a default async request timeout of 30 seconds.
- setURI(URI) - Method in class org.springframework.mock.http.client.MockClientHttpRequest
-
Set the URI of the request.
- setUserPrincipal(Principal) - Method in class org.springframework.mock.web.MockHttpServletRequest
- setUseSuffixPatternMatch(boolean) - Method in class org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder
-
Deprecated.as of 5.2.4. See class-level note in
RequestMappingHandlerMapping
on the deprecation of path extension config options. - setUseTrailingSlashPatternMatch(boolean) - Method in class org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder
-
Deprecated.as of 6.0, see
PathPatternParser.setMatchOptionalTrailingSeparator(boolean)
- setValidator(Validator) - Method in class org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder
-
Provide a custom
Validator
instead of the one created by default. - setViewResolvers(ViewResolver...) - Method in class org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder
-
Set up view resolution with the given
ViewResolvers
. - setWebClient(WebClient) - Method in class org.springframework.test.web.servlet.htmlunit.MockMvcWebConnection
- setWebConnection(WebConnection) - Method in class org.springframework.test.web.servlet.htmlunit.webdriver.WebConnectionHtmlUnitDriver
-
Set the
WebConnection
to be used with theWebClient
. - setWriteHandler(Function<Flux<DataBuffer>, Mono<Void>>) - Method in class org.springframework.mock.http.client.reactive.MockClientHttpRequest
-
Configure a custom handler for writing the request body.
- setWriteHandler(Function<Flux<DataBuffer>, Mono<Void>>) - Method in class org.springframework.mock.http.server.reactive.MockServerHttpResponse
-
Configure a custom handler to consume the response body.
- setWriteListener(WriteListener) - Method in class org.springframework.mock.web.DelegatingServletOutputStream
- setWriterAccessAllowed(boolean) - Method in class org.springframework.mock.web.MockHttpServletResponse
-
Set whether
MockHttpServletResponse.getWriter()
access is allowed. - sharedHttpSession() - Static method in class org.springframework.test.web.servlet.setup.SharedHttpSessionConfigurer
- SharedHttpSessionConfigurer - Class in org.springframework.test.web.servlet.setup
-
MockMvcConfigurer
that stores and re-uses the HTTP session across multiple requests performed through the sameMockMvc
instance. - SharedHttpSessionConfigurer() - Constructor for class org.springframework.test.web.servlet.setup.SharedHttpSessionConfigurer
- SimpleRequestExpectationManager - Class in org.springframework.test.web.client
-
Simple
RequestExpectationManager
that matches requests to expectations sequentially, i.e. - SimpleRequestExpectationManager() - Constructor for class org.springframework.test.web.client.SimpleRequestExpectationManager
- singleView(View) - Method in interface org.springframework.test.web.servlet.client.MockMvcWebTestClient.ControllerSpec
-
Set up a single
ViewResolver
with a fixed view. - size() - Method in interface org.springframework.test.context.cache.ContextCache
-
Determine the number of contexts currently stored in the cache.
- size() - Method in class org.springframework.test.context.cache.DefaultContextCache
- size(int) - Method in class org.springframework.test.web.servlet.result.ModelResultMatchers
-
Assert the number of model attributes.
- SmartContextLoader - Interface in org.springframework.test.context
-
Strategy interface for loading an
ApplicationContext
for an integration test managed by the Spring TestContext Framework. - SmartRequestBuilder - Interface in org.springframework.test.web.servlet
-
Extended variant of a
RequestBuilder
that applies itsorg.springframework.test.web.servlet.request.RequestPostProcessors
as a separate step from theRequestBuilder.buildRequest(jakarta.servlet.ServletContext)
method. - source(Matcher<? super Source>) - Method in class org.springframework.test.web.client.match.ContentRequestMatchers
- source(Matcher<? super Source>) - Method in class org.springframework.test.web.servlet.result.ContentResultMatchers
- SpringClassRule - Class in org.springframework.test.context.junit4.rules
-
SpringClassRule
is a custom JUnitTestRule
that supports class-level features of the Spring TestContext Framework in standard JUnit tests by means of theTestContextManager
and associated support classes and annotations. - SpringClassRule() - Constructor for class org.springframework.test.context.junit4.rules.SpringClassRule
- SpringExtension - Class in org.springframework.test.context.junit.jupiter
-
SpringExtension
integrates the Spring TestContext Framework into JUnit 5's Jupiter programming model. - SpringExtension() - Constructor for class org.springframework.test.context.junit.jupiter.SpringExtension
- SpringFailOnTimeout - Class in org.springframework.test.context.junit4.statements
- SpringFailOnTimeout(Statement, long) - Constructor for class org.springframework.test.context.junit4.statements.SpringFailOnTimeout
-
Construct a new
SpringFailOnTimeout
statement for the suppliedtimeout
. - SpringFailOnTimeout(Statement, Method) - Constructor for class org.springframework.test.context.junit4.statements.SpringFailOnTimeout
-
Construct a new
SpringFailOnTimeout
statement for the suppliedtestMethod
, retrieving the configured timeout from the@Timed
annotation on the supplied method. - SpringJUnit4ClassRunner - Class in org.springframework.test.context.junit4
-
SpringJUnit4ClassRunner
is a custom extension of JUnit'sBlockJUnit4ClassRunner
which provides functionality of the Spring TestContext Framework to standard JUnit tests by means of theTestContextManager
and associated support classes and annotations. - SpringJUnit4ClassRunner(Class<?>) - Constructor for class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
-
Construct a new
SpringJUnit4ClassRunner
and initialize aTestContextManager
to provide Spring testing functionality to standard JUnit tests. - SpringJUnitConfig - Annotation Interface in org.springframework.test.context.junit.jupiter
-
@SpringJUnitConfig
is a composed annotation that combines@ExtendWith(SpringExtension.class)
from JUnit Jupiter with@ContextConfiguration
from the Spring TestContext Framework. - SpringJUnitWebConfig - Annotation Interface in org.springframework.test.context.junit.jupiter.web
-
@SpringJUnitWebConfig
is a composed annotation that combines@ExtendWith(SpringExtension.class)
from JUnit Jupiter with@ContextConfiguration
and@WebAppConfiguration
from the Spring TestContext Framework. - SpringMethodRule - Class in org.springframework.test.context.junit4.rules
-
SpringMethodRule
is a custom JUnit 4MethodRule
that supports instance-level and method-level features of the Spring TestContext Framework in standard JUnit tests by means of theTestContextManager
and associated support classes and annotations. - SpringMethodRule() - Constructor for class org.springframework.test.context.junit4.rules.SpringMethodRule
- SpringRepeat - Class in org.springframework.test.context.junit4.statements
- SpringRepeat(Statement, Method) - Constructor for class org.springframework.test.context.junit4.statements.SpringRepeat
-
Construct a new
SpringRepeat
statement for the suppliedtestMethod
, retrieving the configured repeat count from the@Repeat
annotation on the supplied method. - SpringRepeat(Statement, Method, int) - Constructor for class org.springframework.test.context.junit4.statements.SpringRepeat
-
Construct a new
SpringRepeat
statement for the suppliedtestMethod
andrepeat
count. - SpringRunner - Class in org.springframework.test.context.junit4
-
SpringRunner
is an alias for theSpringJUnit4ClassRunner
. - SpringRunner(Class<?>) - Constructor for class org.springframework.test.context.junit4.SpringRunner
-
Construct a new
SpringRunner
and initialize aTestContextManager
to provide Spring testing functionality to standard JUnit 4 tests. - springTestContextAfterTestClass() - Method in class org.springframework.test.context.testng.AbstractTestNGSpringContextTests
-
Delegates to the configured
TestContextManager
to call 'after test class' callbacks. - springTestContextAfterTestMethod(Method) - Method in class org.springframework.test.context.testng.AbstractTestNGSpringContextTests
-
Delegates to the configured
TestContextManager
to post-process the test method after the actual test has executed. - springTestContextBeforeTestClass() - Method in class org.springframework.test.context.testng.AbstractTestNGSpringContextTests
-
Delegates to the configured
TestContextManager
to call 'before test class' callbacks. - springTestContextBeforeTestMethod(Method) - Method in class org.springframework.test.context.testng.AbstractTestNGSpringContextTests
-
Delegates to the configured
TestContextManager
to pre-process the test method before the actual test is executed. - springTestContextPrepareTestInstance() - Method in class org.springframework.test.context.testng.AbstractTestNGSpringContextTests
-
Delegates to the configured
TestContextManager
to prepare this test instance prior to execution of any individual tests, for example for injecting dependencies, etc. - Sql - Annotation Interface in org.springframework.test.context.jdbc
-
@Sql
is used to annotate a test class or test method to configure SQLSql.scripts()
andSql.statements()
to be executed against a given database during integration tests. - Sql.ExecutionPhase - Enum Class in org.springframework.test.context.jdbc
-
Enumeration of phases that dictate when SQL scripts are executed.
- SqlConfig - Annotation Interface in org.springframework.test.context.jdbc
-
@SqlConfig
defines metadata that is used to determine how to parse and execute SQL scripts configured via the@Sql
annotation. - SqlConfig.ErrorMode - Enum Class in org.springframework.test.context.jdbc
-
Enumeration of modes that dictate how errors are handled while executing SQL statements.
- SqlConfig.TransactionMode - Enum Class in org.springframework.test.context.jdbc
-
Enumeration of modes that dictate whether SQL scripts should be executed within a transaction and what the transaction propagation behavior should be.
- SqlGroup - Annotation Interface in org.springframework.test.context.jdbc
-
Container annotation that aggregates several
@Sql
annotations. - SqlMergeMode - Annotation Interface in org.springframework.test.context.jdbc
-
@SqlMergeMode
is used to annotate a test class or test method to configure whether method-level@Sql
declarations are merged with class-level@Sql
declarations. - SqlMergeMode.MergeMode - Enum Class in org.springframework.test.context.jdbc
-
Enumeration of modes that dictate whether method-level
@Sql
declarations are merged with class-level@Sql
declarations. - SqlScriptsTestExecutionListener - Class in org.springframework.test.context.jdbc
-
TestExecutionListener
that provides support for executing SQLscripts
and inlinedstatements
configured via the@Sql
annotation. - SqlScriptsTestExecutionListener() - Constructor for class org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener
- sslInfo(SslInfo) - Method in interface org.springframework.mock.http.server.reactive.MockServerHttpRequest.BaseBuilder
-
Set SSL session information and certificates.
- StandaloneMockMvcBuilder - Class in org.springframework.test.web.servlet.setup
-
A
MockMvcBuilder
that accepts@Controller
registrations thus allowing full control over the instantiation and initialization of controllers and their dependencies similar to plain unit tests, and also making it possible to test one controller at a time. - StandaloneMockMvcBuilder(Object...) - Constructor for class org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder
-
Protected constructor.
- standaloneSetup(Object...) - Static method in class org.springframework.test.web.servlet.setup.MockMvcBuilders
-
Build a
MockMvc
instance by registering one or more@Controller
instances and configuring Spring MVC infrastructure programmatically. - start() - Method in class org.springframework.mock.web.server.MockWebSession
- start() - Static method in class org.springframework.test.context.transaction.TestTransaction
-
Start a new test-managed transaction.
- start(Runnable) - Method in class org.springframework.mock.web.MockAsyncContext
- startAsync() - Method in class org.springframework.mock.web.MockHttpServletRequest
- startAsync(ServletRequest, ServletResponse) - Method in class org.springframework.mock.web.MockHttpServletRequest
- statements() - Element in annotation interface org.springframework.test.context.jdbc.Sql
-
Inlined SQL statements to execute.
- status() - Static method in class org.springframework.test.web.servlet.result.MockMvcResultMatchers
-
Access to response status assertions.
- StatusAssertions - Class in org.springframework.test.web.reactive.server
-
Assertions on the response status.
- StatusResultMatchers - Class in org.springframework.test.web.servlet.result
-
Factory for assertions on the response status.
- StatusResultMatchers() - Constructor for class org.springframework.test.web.servlet.result.StatusResultMatchers
-
Protected constructor.
- stream() - Method in interface org.springframework.test.context.event.ApplicationEvents
-
Stream all application events that were fired during test execution.
- stream(Class<T>) - Method in interface org.springframework.test.context.event.ApplicationEvents
-
Stream all application events or event payloads of the given type that were fired during test execution.
- string(String) - Method in class org.springframework.test.web.client.match.ContentRequestMatchers
-
Get the body of the request as a UTF-8 string and compare it to the given String.
- string(String) - Method in class org.springframework.test.web.client.match.XpathRequestMatchers
-
Apply the XPath and assert the String content found.
- string(String) - Method in class org.springframework.test.web.servlet.result.ContentResultMatchers
-
Assert the response body content as a String.
- string(String) - Method in class org.springframework.test.web.servlet.result.XpathResultMatchers
-
Apply the XPath and assert the
String
value found. - string(String, String) - Method in class org.springframework.test.web.servlet.result.HeaderResultMatchers
-
Assert the primary value of the response header as a String value.
- string(String, Matcher<? super String>) - Method in class org.springframework.test.web.servlet.result.HeaderResultMatchers
-
Assert the primary value of the response header with the given Hamcrest String
Matcher
. - string(Consumer<String>) - Method in class org.springframework.test.web.reactive.server.XpathAssertions
-
Consume the result of the XPath evaluation as a String.
- string(Matcher<? super String>) - Method in class org.springframework.test.web.client.match.ContentRequestMatchers
-
Get the body of the request as a UTF-8 string and apply the given
Matcher
. - string(Matcher<? super String>) - Method in class org.springframework.test.web.client.match.XpathRequestMatchers
-
Apply the XPath and assert the String content found with the given matcher.
- string(Matcher<? super String>) - Method in class org.springframework.test.web.reactive.server.XpathAssertions
- string(Matcher<? super String>) - Method in class org.springframework.test.web.servlet.result.ContentResultMatchers
-
Assert the response body content with a Hamcrest
Matcher
. - string(Matcher<? super String>) - Method in class org.springframework.test.web.servlet.result.XpathResultMatchers
- stringValues(String, String...) - Method in class org.springframework.test.web.servlet.result.HeaderResultMatchers
-
Assert the values of the response header as String values.
- stringValues(String, Matcher<? super Iterable<String>>) - Method in class org.springframework.test.web.servlet.result.HeaderResultMatchers
-
Assert the values of the response header with the given Hamcrest Iterable
Matcher
. - supportsParameter(ParameterContext, ExtensionContext) - Method in class org.springframework.test.context.junit.jupiter.SpringExtension
-
Determine if the value for the
Parameter
in the suppliedParameterContext
should be autowired from the test'sApplicationContext
. - syncBody(Object) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.RequestBodySpec
-
Deprecated.as of Spring Framework 5.2 in favor of
WebTestClient.RequestBodySpec.bodyValue(Object)
- SystemProfileValueSource - Class in org.springframework.test.annotation
-
Implementation of
ProfileValueSource
which uses system properties as the underlying source.
T
- TEST_CONSTRUCTOR_AUTOWIRE_MODE_PROPERTY_NAME - Static variable in annotation interface org.springframework.test.context.TestConstructor
-
JVM system property used to change the default test constructor autowire mode: "spring.test.constructor.autowire.mode".
- TestAnnotationUtils - Class in org.springframework.test.annotation
-
Collection of utility methods for working with Spring's core testing annotations.
- TestAnnotationUtils() - Constructor for class org.springframework.test.annotation.TestAnnotationUtils
- TestAotProcessor - Class in org.springframework.test.context.aot
-
Filesystem-based ahead-of-time (AOT) processing base implementation that scans the provided classpath roots for Spring integration test classes and then generates AOT artifacts for those test classes in the configured output directories.
- TestAotProcessor(Set<Path>, AbstractAotProcessor.Settings) - Constructor for class org.springframework.test.context.aot.TestAotProcessor
-
Create a new processor for the specified test classpath roots and common settings.
- TestConstructor - Annotation Interface in org.springframework.test.context
-
@TestConstructor
is a type-level annotation that is used to configure how the parameters of a test class constructor are autowired from components in the test'sApplicationContext
. - TestConstructor.AutowireMode - Enum Class in org.springframework.test.context
-
Defines autowiring modes for parameters in a test constructor.
- TestConstructorUtils - Class in org.springframework.test.context.support
-
Utility methods for working with
@TestConstructor
. - TestContext - Interface in org.springframework.test.context
-
TestContext
encapsulates the context in which a test is executed, agnostic of the actual testing framework in use. - TestContextAnnotationUtils - Class in org.springframework.test.context
-
TestContextAnnotationUtils
is a collection of utility methods that complements the standard support already available inAnnotationUtils
andAnnotatedElementUtils
, while transparently honoring@NestedTestConfiguration
semantics. - TestContextAnnotationUtils() - Constructor for class org.springframework.test.context.TestContextAnnotationUtils
- TestContextAnnotationUtils.AnnotationDescriptor<T extends Annotation> - Class in org.springframework.test.context
-
Descriptor for an
Annotation
, including the class on which the annotation is declared as well as the merged annotation instance. - TestContextAnnotationUtils.UntypedAnnotationDescriptor - Class in org.springframework.test.context
-
Untyped extension of
TestContextAnnotationUtils.AnnotationDescriptor
that is used to describe the declaration of one of several candidate annotation types where the actual annotation type cannot be predetermined. - TestContextAotException - Exception in org.springframework.test.context.aot
-
Thrown if an error occurs during AOT build-time processing or AOT run-time execution in the Spring TestContext Framework.
- TestContextAotException(String) - Constructor for exception org.springframework.test.context.aot.TestContextAotException
-
Create a new
TestContextAotException
. - TestContextAotException(String, Throwable) - Constructor for exception org.springframework.test.context.aot.TestContextAotException
-
Create a new
TestContextAotException
. - TestContextAotGenerator - Class in org.springframework.test.context.aot
-
TestContextAotGenerator
generates AOT artifacts for integration tests that depend on support from the Spring TestContext Framework. - TestContextAotGenerator(GeneratedFiles) - Constructor for class org.springframework.test.context.aot.TestContextAotGenerator
-
Create a new
TestContextAotGenerator
that uses the suppliedGeneratedFiles
. - TestContextAotGenerator(GeneratedFiles, RuntimeHints) - Constructor for class org.springframework.test.context.aot.TestContextAotGenerator
- TestContextAotGenerator(GeneratedFiles, RuntimeHints, boolean) - Constructor for class org.springframework.test.context.aot.TestContextAotGenerator
-
Create a new
TestContextAotGenerator
that uses the suppliedGeneratedFiles
,RuntimeHints
, andfailOnError
flag. - TestContextBootstrapper - Interface in org.springframework.test.context
-
TestContextBootstrapper
defines the SPI for bootstrapping the Spring TestContext Framework. - TestContextEvent - Class in org.springframework.test.context.event
-
Base class for events published by the
EventPublishingTestExecutionListener
. - TestContextEvent(TestContext) - Constructor for class org.springframework.test.context.event.TestContextEvent
-
Create a new
TestContextEvent
. - TestContextManager - Class in org.springframework.test.context
-
TestContextManager
is the main entry point into the Spring TestContext Framework. - TestContextManager(Class<?>) - Constructor for class org.springframework.test.context.TestContextManager
-
Construct a new
TestContextManager
for the supplied test class. - TestContextManager(TestContextBootstrapper) - Constructor for class org.springframework.test.context.TestContextManager
-
Construct a new
TestContextManager
using the suppliedTestContextBootstrapper
and register the necessaryTestExecutionListeners
. - TestContextResourceUtils - Class in org.springframework.test.context.util
-
Utility methods for working with resources within the Spring TestContext Framework.
- TestContextResourceUtils() - Constructor for class org.springframework.test.context.util.TestContextResourceUtils
- TestContextSpringFactoriesUtils - Class in org.springframework.test.context.util
-
Collection of utilities for working with
SpringFactoriesLoader
within the Spring TestContext Framework. - TestContextTransactionUtils - Class in org.springframework.test.context.transaction
-
Utility methods for working with transactions and data access related beans within the Spring TestContext Framework.
- TestContextTransactionUtils() - Constructor for class org.springframework.test.context.transaction.TestContextTransactionUtils
- TestExecutionListener - Interface in org.springframework.test.context
-
TestExecutionListener
defines a listener API for reacting to test execution events published by theTestContextManager
with which the listener is registered. - TestExecutionListeners - Annotation Interface in org.springframework.test.context
-
TestExecutionListeners
defines class-level metadata for configuring whichTestExecutionListeners
should be registered with aTestContextManager
. - TestExecutionListeners.MergeMode - Enum Class in org.springframework.test.context
-
Enumeration of modes that dictate whether explicitly declared listeners are merged with the default listeners when
@TestExecutionListeners
is declared on a class that does not inherit listeners from a superclass or enclosing class. - TestPropertySource - Annotation Interface in org.springframework.test.context
-
@TestPropertySource
is a class-level annotation that is used to configure theTestPropertySource.locations()
of properties files and inlinedTestPropertySource.properties()
to be added to theEnvironment
's set ofPropertySources
for anApplicationContext
for integration tests. - TestPropertySources - Annotation Interface in org.springframework.test.context
-
@TestPropertySources
is a container for one or more@TestPropertySource
declarations. - TestPropertySourceUtils - Class in org.springframework.test.context.support
-
Utility methods for working with
@TestPropertySource
and adding testPropertySources
to theEnvironment
. - TestPropertySourceUtils() - Constructor for class org.springframework.test.context.support.TestPropertySourceUtils
- TestRuntimeHintsRegistrar - Interface in org.springframework.test.context.aot
-
Contract for registering
RuntimeHints
for integration tests run with the Spring TestContext Framework based on theClassLoader
of the deployment unit. - TestSocketUtils - Class in org.springframework.test.util
-
Simple utility for finding available TCP ports on
localhost
for use in integration testing scenarios. - TestSocketUtils() - Constructor for class org.springframework.test.util.TestSocketUtils
-
Although
TestSocketUtils
consists solely of static utility methods, this constructor is intentionallypublic
. - TestTransaction - Class in org.springframework.test.context.transaction
-
TestTransaction
provides a collection of static utility methods for programmatic interaction with test-managed transactions within test methods, before methods, and after methods. - Timed - Annotation Interface in org.springframework.test.annotation
-
Test annotation for use with JUnit 4 to indicate that a test method has to finish execution in a specified time period.
- times(int) - Static method in class org.springframework.test.web.client.ExpectedCount
-
Exactly N times.
- toString() - Method in class org.springframework.mock.http.client.MockClientHttpRequest
- toString() - Method in class org.springframework.mock.http.client.reactive.MockClientHttpResponse
- toString() - Method in class org.springframework.mock.web.MockCookie
- toString() - Method in class org.springframework.mock.web.MockHttpServletMapping
- toString() - Method in class org.springframework.test.context.cache.DefaultContextCache
-
Generate a text string containing the implementation type of this cache and its statistics.
- toString() - Method in class org.springframework.test.context.ContextConfigurationAttributes
-
Provide a String representation of the context configuration attributes and declaring class.
- toString() - Method in class org.springframework.test.context.MergedContextConfiguration
-
Provide a String representation of the test class, locations, annotated classes, context initializer classes, active profiles, property source descriptors, property source properties, context customizers, the name of the
ContextLoader
, and the parent configuration. - toString() - Method in class org.springframework.test.context.support.DefaultBootstrapContext
-
Provide a String representation of this bootstrap context's state.
- toString() - Method in class org.springframework.test.context.support.DefaultTestContext
-
Provide a String representation of this test context's state.
- toString() - Method in class org.springframework.test.context.TestContextAnnotationUtils.AnnotationDescriptor
-
Provide a textual representation of this
AnnotationDescriptor
. - toString() - Method in class org.springframework.test.context.web.WebMergedContextConfiguration
-
Provide a String representation of the test class, locations, annotated classes, context initializer classes, active profiles, property source descriptors, property source properties, context customizers, resource base path, the name of the
ContextLoader
, and the parent configuration. - toString() - Method in class org.springframework.test.web.reactive.server.ExchangeResult
- TransactionalTestExecutionListener - Class in org.springframework.test.context.transaction
-
TestExecutionListener
that provides support for executing tests within test-managed transactions by honoring Spring's@Transactional
annotation. - TransactionalTestExecutionListener() - Constructor for class org.springframework.test.context.transaction.TransactionalTestExecutionListener
- transactionManager() - Element in annotation interface org.springframework.test.context.jdbc.SqlConfig
-
The bean name of the
PlatformTransactionManager
that should be used to drive transactions. - transactionMode() - Element in annotation interface org.springframework.test.context.jdbc.SqlConfig
-
The mode to use when determining whether SQL scripts should be executed within a transaction.
- transferTo(File) - Method in class org.springframework.mock.web.MockMultipartFile
- twice() - Static method in class org.springframework.test.web.client.ExpectedCount
-
Exactly twice.
U
- UnorderedRequestExpectationManager - Class in org.springframework.test.web.client
-
RequestExpectationManager
that matches requests to expectations regardless of the order of declaration of expected requests. - UnorderedRequestExpectationManager() - Constructor for class org.springframework.test.web.client.UnorderedRequestExpectationManager
- unregisterNamedDispatcher(String) - Method in class org.springframework.mock.web.MockServletContext
-
Unregister the
RequestDispatcher
with the given name. - update(RequestExpectation) - Method in class org.springframework.test.web.client.AbstractRequestExpectationManager.RequestExpectationGroup
-
Invoke this for an expectation that has been matched.
- updateState(Object, Method, Throwable) - Method in class org.springframework.test.context.support.DefaultTestContext
- updateState(Object, Method, Throwable) - Method in interface org.springframework.test.context.TestContext
-
Update this test context to reflect the state of the currently executing test.
- upgrade(Class<T>) - Method in class org.springframework.mock.web.MockHttpServletRequest
- uri() - Method in class org.springframework.mock.web.reactive.function.server.MockServerRequest
- uri(String, Object...) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.UriSpec
-
Specify the URI for the request using a URI template and URI variables.
- uri(String, Map<String, ?>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.UriSpec
-
Specify the URI for the request using a URI template and URI variables.
- uri(URI) - Method in interface org.springframework.mock.web.reactive.function.server.MockServerRequest.Builder
- uri(URI) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.UriSpec
-
Specify the URI using an absolute, fully constructed
URI
. - uri(Function<UriBuilder, URI>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.UriSpec
-
Build the URI for the request with a
UriBuilder
obtained through theUriBuilderFactory
configured for this client. - uriBuilder() - Method in class org.springframework.mock.web.reactive.function.server.MockServerRequest
- uriBuilderFactory(UriBuilderFactory) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.Builder
-
Provide a pre-configured
UriBuilderFactory
instance as an alternative to and effectively overridingWebTestClient.Builder.baseUrl(String)
. - UrlRegexRequestMatcher - Class in org.springframework.test.web.servlet.htmlunit
-
A
WebRequestMatcher
that allows matching onWebRequest#getUrl().toExternalForm()
using a regular expression. - UrlRegexRequestMatcher(String) - Constructor for class org.springframework.test.web.servlet.htmlunit.UrlRegexRequestMatcher
- UrlRegexRequestMatcher(Pattern) - Constructor for class org.springframework.test.web.servlet.htmlunit.UrlRegexRequestMatcher
- useMockMvc(WebRequestMatcher...) - Method in class org.springframework.test.web.servlet.htmlunit.MockMvcWebConnectionBuilderSupport
-
Add additional
WebRequestMatcher
instances that will ensure thatMockMvc
is used to process the request, if such a matcher matches against the web request. - useMockMvcForHosts(String...) - Method in class org.springframework.test.web.servlet.htmlunit.MockMvcWebConnectionBuilderSupport
-
Add additional
WebRequestMatcher
instances that returntrue
if a supplied host matches — for example,"example.com"
or"example.com:8080"
. - useTrailingSlashPatternMatch(boolean) - Method in interface org.springframework.test.web.servlet.client.MockMvcWebTestClient.ControllerSpec
-
Deprecated.as of 6.0, see
PathPatternParser.setMatchOptionalTrailingSeparator(boolean)
V
- validateMergedContextConfiguration(MergedContextConfiguration) - Method in class org.springframework.test.context.support.AbstractGenericContextLoader
-
Validate the supplied
MergedContextConfiguration
with respect to what this context loader supports. - validateMergedContextConfiguration(MergedContextConfiguration) - Method in class org.springframework.test.context.support.AnnotationConfigContextLoader
-
Ensure that the supplied
MergedContextConfiguration
does not containlocations
. - validateMergedContextConfiguration(MergedContextConfiguration) - Method in class org.springframework.test.context.support.GenericXmlContextLoader
-
Ensure that the supplied
MergedContextConfiguration
does not containclasses
. - validateMergedContextConfiguration(WebMergedContextConfiguration) - Method in class org.springframework.test.context.web.AbstractGenericWebContextLoader
-
Validate the supplied
WebMergedContextConfiguration
with respect to what this context loader supports. - validateMergedContextConfiguration(WebMergedContextConfiguration) - Method in class org.springframework.test.context.web.AnnotationConfigWebContextLoader
-
Ensure that the supplied
WebMergedContextConfiguration
does not containlocations
. - validateMergedContextConfiguration(WebMergedContextConfiguration) - Method in class org.springframework.test.context.web.GenericXmlWebContextLoader
-
Ensure that the supplied
WebMergedContextConfiguration
does not containclasses
. - validateRequest(ClientHttpRequest) - Method in class org.springframework.test.web.client.AbstractRequestExpectationManager
- validateRequest(ClientHttpRequest) - Method in interface org.springframework.test.web.client.RequestExpectationManager
-
Validate the given actual request against the declared expectations.
- validator(Validator) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.ControllerSpec
-
Configure a global Validator.
- validator(Validator) - Method in interface org.springframework.test.web.servlet.client.MockMvcWebTestClient.ControllerSpec
-
Provide a custom
Validator
. - value() - Element in annotation interface org.springframework.test.annotation.IfProfileValue
-
A single, permissible
value
of the profile value for the givenIfProfileValue.name()
. - value() - Element in annotation interface org.springframework.test.annotation.ProfileValueSourceConfiguration
-
The type of
ProfileValueSource
to use when retrieving profile values. - value() - Element in annotation interface org.springframework.test.annotation.Repeat
-
The number of times that the annotated test method should be repeated.
- value() - Element in annotation interface org.springframework.test.annotation.Rollback
-
Whether the test-managed transaction should be rolled back after the test method has completed.
- value() - Element in annotation interface org.springframework.test.context.ActiveProfiles
-
Alias for
ActiveProfiles.profiles()
. - value() - Element in annotation interface org.springframework.test.context.BootstrapWith
-
The
TestContextBootstrapper
to use to bootstrap the Spring TestContext Framework. - value() - Element in annotation interface org.springframework.test.context.ContextConfiguration
-
Alias for
ContextConfiguration.locations()
. - value() - Element in annotation interface org.springframework.test.context.ContextCustomizerFactories
-
Alias for
ContextCustomizerFactories.factories()
. - value() - Element in annotation interface org.springframework.test.context.ContextHierarchy
-
A list of
@ContextConfiguration
instances, each of which defines a level in the context hierarchy. - value() - Element in annotation interface org.springframework.test.context.event.annotation.AfterTestClass
-
Alias for
EventListener.condition()
. - value() - Element in annotation interface org.springframework.test.context.event.annotation.AfterTestExecution
-
Alias for
EventListener.condition()
. - value() - Element in annotation interface org.springframework.test.context.event.annotation.AfterTestMethod
-
Alias for
EventListener.condition()
. - value() - Element in annotation interface org.springframework.test.context.event.annotation.BeforeTestClass
-
Alias for
EventListener.condition()
. - value() - Element in annotation interface org.springframework.test.context.event.annotation.BeforeTestExecution
-
Alias for
EventListener.condition()
. - value() - Element in annotation interface org.springframework.test.context.event.annotation.BeforeTestMethod
-
Alias for
EventListener.condition()
. - value() - Element in annotation interface org.springframework.test.context.event.annotation.PrepareTestInstance
-
Alias for
EventListener.condition()
. - value() - Element in annotation interface org.springframework.test.context.jdbc.Sql
-
Alias for
Sql.scripts()
. - value() - Element in annotation interface org.springframework.test.context.jdbc.SqlGroup
- value() - Element in annotation interface org.springframework.test.context.jdbc.SqlMergeMode
-
Indicates whether method-level
@Sql
annotations should be merged with class-level@Sql
annotations or override them. - value() - Element in annotation interface org.springframework.test.context.junit.jupiter.DisabledIf
-
Alias for
DisabledIf.expression()
; only intended to be used ifDisabledIf.reason()
andDisabledIf.loadContext()
are not specified. - value() - Element in annotation interface org.springframework.test.context.junit.jupiter.EnabledIf
-
Alias for
EnabledIf.expression()
; only intended to be used ifEnabledIf.reason()
andEnabledIf.loadContext()
are not specified. - value() - Element in annotation interface org.springframework.test.context.junit.jupiter.SpringJUnitConfig
-
Alias for
ContextConfiguration.classes()
. - value() - Element in annotation interface org.springframework.test.context.junit.jupiter.web.SpringJUnitWebConfig
-
Alias for
ContextConfiguration.classes()
. - value() - Element in annotation interface org.springframework.test.context.NestedTestConfiguration
-
Configures the
NestedTestConfiguration.EnclosingConfiguration
mode. - value() - Element in annotation interface org.springframework.test.context.TestExecutionListeners
-
Alias for
TestExecutionListeners.listeners()
. - value() - Element in annotation interface org.springframework.test.context.TestPropertySource
-
Alias for
TestPropertySource.locations()
. - value() - Element in annotation interface org.springframework.test.context.TestPropertySources
-
An array of one or more
@TestPropertySource
declarations. - value() - Element in annotation interface org.springframework.test.context.web.WebAppConfiguration
-
The resource path to the root directory of the web application.
- value(Object) - Method in class org.springframework.test.web.client.match.JsonPathRequestMatchers
-
Evaluate the JSON path expression against the request content and assert that the result is equal to the supplied value.
- value(Object) - Method in class org.springframework.test.web.servlet.result.JsonPathResultMatchers
-
Evaluate the JSON path expression against the response content and assert that the result is equal to the supplied value.
- value(String, String) - Method in class org.springframework.test.web.servlet.result.CookieResultMatchers
-
Assert a cookie value.
- value(String, Consumer<String>) - Method in class org.springframework.test.web.reactive.server.CookieAssertions
-
Consume the value of the response cookie.
- value(String, Consumer<String>) - Method in class org.springframework.test.web.reactive.server.HeaderAssertions
-
Consume the first value of the named response header.
- value(String, Matcher<? super String>) - Method in class org.springframework.test.web.reactive.server.CookieAssertions
-
Assert the first value of the response cookie with a Hamcrest
Matcher
. - value(String, Matcher<? super String>) - Method in class org.springframework.test.web.reactive.server.HeaderAssertions
-
Assert the first value of the response header with a Hamcrest
Matcher
. - value(String, Matcher<? super String>) - Method in class org.springframework.test.web.servlet.result.CookieResultMatchers
-
Assert a cookie value with the given Hamcrest
Matcher
. - value(Consumer<B>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.BodySpec
-
Assert the extracted body with a
Consumer
. - value(Consumer<Integer>) - Method in class org.springframework.test.web.reactive.server.StatusAssertions
-
Consume the response status value as an integer.
- value(Consumer<T>) - Method in class org.springframework.test.web.reactive.server.JsonPathAssertions
-
Consume the result of the JSONPath evaluation.
- value(Consumer<T>, Class<T>) - Method in class org.springframework.test.web.reactive.server.JsonPathAssertions
-
Consume the result of the JSONPath evaluation and provide a target class.
- value(Function<B, R>, Matcher<? super R>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.BodySpec
-
Transform the extracted the body with a function, e.g.
- value(Matcher<? super B>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.BodySpec
-
Assert the extracted body with a
Matcher
. - value(Matcher<? super Integer>) - Method in class org.springframework.test.web.reactive.server.StatusAssertions
-
Match the response status value with a Hamcrest matcher.
- value(Matcher<? super T>) - Method in class org.springframework.test.web.client.match.JsonPathRequestMatchers
-
Evaluate the JSON path expression against the request content and assert the resulting value with the given Hamcrest
Matcher
. - value(Matcher<? super T>) - Method in class org.springframework.test.web.reactive.server.JsonPathAssertions
-
Delegates to
JsonPathExpectationsHelper.assertValue(String, Matcher)
. - value(Matcher<? super T>) - Method in class org.springframework.test.web.servlet.result.JsonPathResultMatchers
-
Evaluate the JSON path expression against the response content and assert the resulting value with the given Hamcrest
Matcher
. - value(Matcher<? super T>, Class<T>) - Method in class org.springframework.test.web.client.match.JsonPathRequestMatchers
-
An overloaded variant of
JsonPathRequestMatchers.value(Matcher)
that also accepts a target type for the resulting value that the matcher can work reliably against. - value(Matcher<? super T>, Class<T>) - Method in class org.springframework.test.web.reactive.server.JsonPathAssertions
- value(Matcher<? super T>, Class<T>) - Method in class org.springframework.test.web.servlet.result.JsonPathResultMatchers
-
An overloaded variant of
JsonPathResultMatchers.value(Matcher)
that also accepts a target type for the resulting value that the matcher can work reliably against. - valueEquals(String, long) - Method in class org.springframework.test.web.reactive.server.HeaderAssertions
-
Expect a header with the given name to match the given long value.
- valueEquals(String, String) - Method in class org.springframework.test.web.reactive.server.CookieAssertions
-
Expect a header with the given name to match the specified values.
- valueEquals(String, String...) - Method in class org.springframework.test.web.reactive.server.HeaderAssertions
-
Expect a header with the given name to match the specified values.
- valueEqualsDate(String, long) - Method in class org.springframework.test.web.reactive.server.HeaderAssertions
-
Expect a header with the given name to match the specified long value parsed into a date using the preferred date format described in RFC 7231.
- valueMatches(String, String) - Method in class org.springframework.test.web.reactive.server.HeaderAssertions
-
Match the first value of the response header with a regex.
- valueOf(String) - Static method in enum class org.springframework.test.annotation.DirtiesContext.ClassMode
-
Returns the enum constant of this class with the specified name.
- valueOf(String) - Static method in enum class org.springframework.test.annotation.DirtiesContext.HierarchyMode
-
Returns the enum constant of this class with the specified name.
- valueOf(String) - Static method in enum class org.springframework.test.annotation.DirtiesContext.MethodMode
-
Returns the enum constant of this class with the specified name.
- valueOf(String) - Static method in enum class org.springframework.test.context.ContextCustomizerFactories.MergeMode
-
Returns the enum constant of this class with the specified name.
- valueOf(String) - Static method in enum class org.springframework.test.context.jdbc.Sql.ExecutionPhase
-
Returns the enum constant of this class with the specified name.
- valueOf(String) - Static method in enum class org.springframework.test.context.jdbc.SqlConfig.ErrorMode
-
Returns the enum constant of this class with the specified name.
- valueOf(String) - Static method in enum class org.springframework.test.context.jdbc.SqlConfig.TransactionMode
-
Returns the enum constant of this class with the specified name.
- valueOf(String) - Static method in enum class org.springframework.test.context.jdbc.SqlMergeMode.MergeMode
-
Returns the enum constant of this class with the specified name.
- valueOf(String) - Static method in enum class org.springframework.test.context.NestedTestConfiguration.EnclosingConfiguration
-
Returns the enum constant of this class with the specified name.
- valueOf(String) - Static method in enum class org.springframework.test.context.TestConstructor.AutowireMode
-
Returns the enum constant of this class with the specified name.
- valueOf(String) - Static method in enum class org.springframework.test.context.TestExecutionListeners.MergeMode
-
Returns the enum constant of this class with the specified name.
- values() - Static method in enum class org.springframework.test.annotation.DirtiesContext.ClassMode
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values() - Static method in enum class org.springframework.test.annotation.DirtiesContext.HierarchyMode
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values() - Static method in enum class org.springframework.test.annotation.DirtiesContext.MethodMode
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values() - Element in annotation interface org.springframework.test.annotation.IfProfileValue
-
A list of all permissible
values
of the profile value for the givenIfProfileValue.name()
. - values() - Static method in enum class org.springframework.test.context.ContextCustomizerFactories.MergeMode
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values() - Static method in enum class org.springframework.test.context.jdbc.Sql.ExecutionPhase
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values() - Static method in enum class org.springframework.test.context.jdbc.SqlConfig.ErrorMode
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values() - Static method in enum class org.springframework.test.context.jdbc.SqlConfig.TransactionMode
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values() - Static method in enum class org.springframework.test.context.jdbc.SqlMergeMode.MergeMode
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values() - Static method in enum class org.springframework.test.context.NestedTestConfiguration.EnclosingConfiguration
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values() - Static method in enum class org.springframework.test.context.TestConstructor.AutowireMode
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values() - Static method in enum class org.springframework.test.context.TestExecutionListeners.MergeMode
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values(String, Consumer<List<String>>) - Method in class org.springframework.test.web.reactive.server.HeaderAssertions
-
Consume all values of the named response header.
- values(String, Matcher<? super Iterable<String>>) - Method in class org.springframework.test.web.reactive.server.HeaderAssertions
-
Assert all values of the response header with a Hamcrest
Matcher
. - valuesMatch(String, String...) - Method in class org.springframework.test.web.reactive.server.HeaderAssertions
-
Match all values of the response header with the given regex patterns which are applied to the values of the header in the same order.
- verify() - Method in class org.springframework.test.web.client.AbstractRequestExpectationManager
- verify() - Method in class org.springframework.test.web.client.MockRestServiceServer
-
Verify that all expected requests set up via
MockRestServiceServer.expect(RequestMatcher)
were indeed performed. - verify() - Method in interface org.springframework.test.web.client.RequestExpectationManager
-
Verify that all expectations have been met.
- verify(Duration) - Method in class org.springframework.test.web.client.AbstractRequestExpectationManager
- verify(Duration) - Method in class org.springframework.test.web.client.MockRestServiceServer
-
Variant of
MockRestServiceServer.verify()
that waits for up to the specified time for all expectations to be fulfilled. - verify(Duration) - Method in interface org.springframework.test.web.client.RequestExpectationManager
-
Variant of
RequestExpectationManager.verify()
that waits for up to the specified time for all expectations to be fulfilled. - version(String, int) - Method in class org.springframework.test.web.servlet.result.CookieResultMatchers
-
Assert a cookie's version.
- version(String, Matcher<? super Integer>) - Method in class org.springframework.test.web.servlet.result.CookieResultMatchers
-
Assert a cookie's version with a Hamcrest
Matcher
. - view() - Static method in class org.springframework.test.web.servlet.result.MockMvcResultMatchers
-
Access to assertions on the selected view.
- viewResolvers(Consumer<ViewResolverRegistry>) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.ControllerSpec
-
Configure view resolution.
- viewResolvers(ViewResolver...) - Method in interface org.springframework.test.web.servlet.client.MockMvcWebTestClient.ControllerSpec
-
Set up view resolution.
- ViewResultMatchers - Class in org.springframework.test.web.servlet.result
-
Factory for assertions on the selected view.
- ViewResultMatchers() - Constructor for class org.springframework.test.web.servlet.result.ViewResultMatchers
-
Protected constructor.
W
- WebAppConfiguration - Annotation Interface in org.springframework.test.context.web
-
@WebAppConfiguration
is a class-level annotation that is used to declare that theApplicationContext
loaded for an integration test should be aWebApplicationContext
. - webAppContextSetup(WebApplicationContext) - Static method in class org.springframework.test.web.servlet.htmlunit.MockMvcWebClientBuilder
-
Create a new
MockMvcWebClientBuilder
based on the suppliedWebApplicationContext
. - webAppContextSetup(WebApplicationContext) - Static method in class org.springframework.test.web.servlet.htmlunit.webdriver.MockMvcHtmlUnitDriverBuilder
-
Create a new
MockMvcHtmlUnitDriverBuilder
based on the suppliedWebApplicationContext
. - webAppContextSetup(WebApplicationContext) - Static method in class org.springframework.test.web.servlet.setup.MockMvcBuilders
-
Build a
MockMvc
instance using the given, fully initialized (i.e., refreshed)WebApplicationContext
. - webAppContextSetup(WebApplicationContext, MockMvcConfigurer) - Static method in class org.springframework.test.web.servlet.htmlunit.MockMvcWebClientBuilder
-
Create a new
MockMvcWebClientBuilder
based on the suppliedWebApplicationContext
andMockMvcConfigurer
. - webAppContextSetup(WebApplicationContext, MockMvcConfigurer) - Static method in class org.springframework.test.web.servlet.htmlunit.webdriver.MockMvcHtmlUnitDriverBuilder
-
Create a new
MockMvcHtmlUnitDriverBuilder
based on the suppliedWebApplicationContext
andMockMvcConfigurer
. - WebConnectionHtmlUnitDriver - Class in org.springframework.test.web.servlet.htmlunit.webdriver
-
WebConnectionHtmlUnitDriver
enables configuration of theWebConnection
for anHtmlUnitDriver
instance. - WebConnectionHtmlUnitDriver() - Constructor for class org.springframework.test.web.servlet.htmlunit.webdriver.WebConnectionHtmlUnitDriver
- WebConnectionHtmlUnitDriver(boolean) - Constructor for class org.springframework.test.web.servlet.htmlunit.webdriver.WebConnectionHtmlUnitDriver
- WebConnectionHtmlUnitDriver(BrowserVersion) - Constructor for class org.springframework.test.web.servlet.htmlunit.webdriver.WebConnectionHtmlUnitDriver
- WebConnectionHtmlUnitDriver(Capabilities) - Constructor for class org.springframework.test.web.servlet.htmlunit.webdriver.WebConnectionHtmlUnitDriver
- WebDelegatingSmartContextLoader - Class in org.springframework.test.context.web
-
WebDelegatingSmartContextLoader
is a concrete implementation ofAbstractDelegatingSmartContextLoader
that delegates to aGenericXmlWebContextLoader
(or aGenericGroovyXmlWebContextLoader
if Groovy is present on the classpath) and anAnnotationConfigWebContextLoader
. - WebDelegatingSmartContextLoader() - Constructor for class org.springframework.test.context.web.WebDelegatingSmartContextLoader
- webFilter(WebFilter...) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.MockServerSpec
-
Register
WebFilter
instances to add to the mock server. - WebMergedContextConfiguration - Class in org.springframework.test.context.web
-
WebMergedContextConfiguration
encapsulates the merged context configuration declared on a test class and all of its superclasses and enclosing classes via@ContextConfiguration
,@WebAppConfiguration
,@ActiveProfiles
, and@TestPropertySource
. - WebMergedContextConfiguration(Class<?>, String[], Class<?>[], Set<Class<? extends ApplicationContextInitializer<?>>>, String[], String[], String[], String, ContextLoader, CacheAwareContextLoaderDelegate, MergedContextConfiguration) - Constructor for class org.springframework.test.context.web.WebMergedContextConfiguration
- WebMergedContextConfiguration(Class<?>, String[], Class<?>[], Set<Class<? extends ApplicationContextInitializer<?>>>, String[], String[], String[], Set<ContextCustomizer>, String, ContextLoader, CacheAwareContextLoaderDelegate, MergedContextConfiguration) - Constructor for class org.springframework.test.context.web.WebMergedContextConfiguration
- WebMergedContextConfiguration(Class<?>, String[], Class<?>[], Set<Class<? extends ApplicationContextInitializer<?>>>, String[], List<PropertySourceDescriptor>, String[], Set<ContextCustomizer>, String, ContextLoader, CacheAwareContextLoaderDelegate, MergedContextConfiguration) - Constructor for class org.springframework.test.context.web.WebMergedContextConfiguration
-
Create a new
WebMergedContextConfiguration
instance for the supplied parameters. - WebMergedContextConfiguration(MergedContextConfiguration, String) - Constructor for class org.springframework.test.context.web.WebMergedContextConfiguration
-
Create a new
WebMergedContextConfiguration
instance by copying all properties from the suppliedMergedContextConfiguration
. - WebRequestMatcher - Interface in org.springframework.test.web.servlet.htmlunit
-
Strategy for matching on a
WebRequest
. - webSessionManager(WebSessionManager) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.MockServerSpec
-
Provide a session manager instance for the mock server.
- WebTestClient - Interface in org.springframework.test.web.reactive.server
-
Client for testing web servers that uses
WebClient
internally to perform requests while also providing a fluent API to verify responses. - WEBTESTCLIENT_REQUEST_ID - Static variable in interface org.springframework.test.web.reactive.server.WebTestClient
-
The name of a request header used to assign a unique id to every request performed through the
WebTestClient
. - WebTestClient.BodyContentSpec - Interface in org.springframework.test.web.reactive.server
-
Spec for expectations on the response body content.
- WebTestClient.BodySpec<B,
S extends WebTestClient.BodySpec<B, S>> - Interface in org.springframework.test.web.reactive.server -
Spec for expectations on the response body decoded to a single Object.
- WebTestClient.Builder - Interface in org.springframework.test.web.reactive.server
-
Steps for customizing the
WebClient
used to test with, internally delegating to aWebClient.Builder
. - WebTestClient.ControllerSpec - Interface in org.springframework.test.web.reactive.server
-
Specification for customizing controller configuration equivalent to, and internally delegating to, a
WebFluxConfigurer
. - WebTestClient.ListBodySpec<E> - Interface in org.springframework.test.web.reactive.server
-
Spec for expectations on the response body decoded to a List.
- WebTestClient.MockServerSpec<B extends WebTestClient.MockServerSpec<B>> - Interface in org.springframework.test.web.reactive.server
-
Base specification for setting up tests without a server.
- WebTestClient.RequestBodySpec - Interface in org.springframework.test.web.reactive.server
-
Specification for providing body of a request.
- WebTestClient.RequestBodyUriSpec - Interface in org.springframework.test.web.reactive.server
-
Specification for providing the body and the URI of a request.
- WebTestClient.RequestHeadersSpec<S extends WebTestClient.RequestHeadersSpec<S>> - Interface in org.springframework.test.web.reactive.server
-
Specification for adding request headers and performing an exchange.
- WebTestClient.RequestHeadersUriSpec<S extends WebTestClient.RequestHeadersSpec<S>> - Interface in org.springframework.test.web.reactive.server
-
Specification for providing request headers and the URI of a request.
- WebTestClient.ResponseSpec - Interface in org.springframework.test.web.reactive.server
-
Chained API for applying assertions to a response.
- WebTestClient.ResponseSpec.ResponseSpecConsumer - Interface in org.springframework.test.web.reactive.server
- WebTestClient.RouterFunctionSpec - Interface in org.springframework.test.web.reactive.server
-
Specification for customizing router function configuration.
- WebTestClient.UriSpec<S extends WebTestClient.RequestHeadersSpec<?>> - Interface in org.springframework.test.web.reactive.server
-
Specification for providing the URI of a request.
- WebTestClientConfigurer - Interface in org.springframework.test.web.reactive.server
-
Contract to encapsulate customizations to a
WebTestClient.Builder
. - WebTestContextBootstrapper - Class in org.springframework.test.context.web
-
Web-specific implementation of the
TestContextBootstrapper
SPI. - WebTestContextBootstrapper() - Constructor for class org.springframework.test.context.web.WebTestContextBootstrapper
- with(List<RequestPostProcessor>) - Method in class org.springframework.test.web.servlet.client.MockMvcHttpConnector
-
Create a new instance that applies the given
RequestPostProcessor
s to performed requests. - with(RequestPostProcessor) - Method in interface org.springframework.test.web.servlet.request.ConfigurableSmartRequestBuilder
-
Add the given
RequestPostProcessor
. - with(RequestPostProcessor) - Method in class org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder
-
An extension point for further initialization of
MockHttpServletRequest
in ways not built directly into theMockHttpServletRequestBuilder
. - withAccepted() - Static method in class org.springframework.test.web.client.response.MockRestResponseCreators
-
ResponseCreator
for a 202 response (ACCEPTED). - withAfterClasses(Statement) - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
-
Wrap the
Statement
returned by the parent implementation with aRunAfterTestClassCallbacks
statement, thus preserving the default JUnit functionality while adding support for the Spring TestContext Framework. - withAfters(FrameworkMethod, Object, Statement) - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
-
Wrap the
Statement
returned by the parent implementation with aRunAfterTestMethodCallbacks
statement, thus preserving the default functionality while adding support for the Spring TestContext Framework. - withAfterTestExecutionCallbacks(FrameworkMethod, Object, Statement) - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
-
Wrap the supplied
Statement
with aRunAfterTestExecutionCallbacks
statement, thus preserving the default functionality while adding support for the Spring TestContext Framework. - withBadGateway() - Static method in class org.springframework.test.web.client.response.MockRestResponseCreators
-
ResponseCreator
for a 502 response (BAD_GATEWAY). - withBadRequest() - Static method in class org.springframework.test.web.client.response.MockRestResponseCreators
-
ResponseCreator
for a 400 response (BAD_REQUEST). - withBeforeClasses(Statement) - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
-
Wrap the
Statement
returned by the parent implementation with aRunBeforeTestClassCallbacks
statement, thus preserving the default JUnit functionality while adding support for the Spring TestContext Framework. - withBefores(FrameworkMethod, Object, Statement) - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
-
Wrap the
Statement
returned by the parent implementation with aRunBeforeTestMethodCallbacks
statement, thus preserving the default functionality while adding support for the Spring TestContext Framework. - withBeforeTestExecutionCallbacks(FrameworkMethod, Object, Statement) - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
-
Wrap the supplied
Statement
with aRunBeforeTestExecutionCallbacks
statement, thus preserving the default functionality while adding support for the Spring TestContext Framework. - withCreatedEntity(URI) - Static method in class org.springframework.test.web.client.response.MockRestResponseCreators
-
ResponseCreator
for a 201 response (CREATED) with a 'Location' header. - withDelegate(WebClient) - Method in class org.springframework.test.web.servlet.htmlunit.MockMvcWebClientBuilder
- withDelegate(WebConnectionHtmlUnitDriver) - Method in class org.springframework.test.web.servlet.htmlunit.webdriver.MockMvcHtmlUnitDriverBuilder
- withException(IOException) - Static method in class org.springframework.test.web.client.response.MockRestResponseCreators
-
ResponseCreator
with an internal applicationIOException
. - withForbiddenRequest() - Static method in class org.springframework.test.web.client.response.MockRestResponseCreators
-
ResponseCreator
for a 403 response (FORBIDDEN). - withGatewayTimeout() - Static method in class org.springframework.test.web.client.response.MockRestResponseCreators
-
ResponseCreator
for a 504 response (GATEWAY_TIMEOUT). - withNoContent() - Static method in class org.springframework.test.web.client.response.MockRestResponseCreators
-
ResponseCreator
for a 204 response (NO_CONTENT). - withPotentialRepeat(FrameworkMethod, Object, Statement) - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
-
Wrap the supplied
Statement
with aSpringRepeat
statement. - withPotentialTimeout(FrameworkMethod, Object, Statement) - Method in class org.springframework.test.context.junit4.SpringJUnit4ClassRunner
-
Perform the same logic as
BlockJUnit4ClassRunner.withPotentialTimeout(FrameworkMethod, Object, Statement)
but with additional support for Spring's@Timed
annotation. - withProperty(String, Object) - Method in class org.springframework.mock.env.MockPropertySource
-
Convenient synonym for
MockPropertySource.setProperty(java.lang.String, java.lang.Object)
that returns the current instance. - withProperty(String, String) - Method in class org.springframework.mock.env.MockEnvironment
-
Convenient synonym for
MockEnvironment.setProperty(java.lang.String, java.lang.String)
that returns the current instance. - withRawStatus(int) - Static method in class org.springframework.test.web.client.response.MockRestResponseCreators
-
Variant of
MockRestResponseCreators.withStatus(HttpStatusCode)
with an integer. - withRequestConflict() - Static method in class org.springframework.test.web.client.response.MockRestResponseCreators
-
ResponseCreator
for a 409 response (CONFLICT). - withResourceNotFound() - Static method in class org.springframework.test.web.client.response.MockRestResponseCreators
-
ResponseCreator
for a 404 response (NOT_FOUND). - withServerError() - Static method in class org.springframework.test.web.client.response.MockRestResponseCreators
-
ResponseCreator
for a 500 response (SERVER_ERROR). - withServiceUnavailable() - Static method in class org.springframework.test.web.client.response.MockRestResponseCreators
-
ResponseCreator
for a 503 response (SERVICE_UNAVAILABLE). - withStatus(HttpStatusCode) - Static method in class org.springframework.test.web.client.response.MockRestResponseCreators
-
ResponseCreator
with a specific HTTP status. - withSuccess() - Static method in class org.springframework.test.web.client.response.MockRestResponseCreators
-
ResponseCreator
for a 200 response (OK). - withSuccess(byte[], MediaType) - Static method in class org.springframework.test.web.client.response.MockRestResponseCreators
-
ResponseCreator
for a 200 response (OK) with byte[] body. - withSuccess(String, MediaType) - Static method in class org.springframework.test.web.client.response.MockRestResponseCreators
-
ResponseCreator
for a 200 response (OK) with String body. - withSuccess(Resource, MediaType) - Static method in class org.springframework.test.web.client.response.MockRestResponseCreators
-
ResponseCreator
for a 200 response (OK) content withResource
-based body. - withTooManyRequests() - Static method in class org.springframework.test.web.client.response.MockRestResponseCreators
-
ResponseCreator
for a 429 ratelimited response (TOO_MANY_REQUESTS). - withTooManyRequests(int) - Static method in class org.springframework.test.web.client.response.MockRestResponseCreators
-
ResponseCreator
for a 429 rate-limited response (TOO_MANY_REQUESTS) with aRetry-After
header in seconds. - withUnauthorizedRequest() - Static method in class org.springframework.test.web.client.response.MockRestResponseCreators
-
ResponseCreator
for a 401 response (UNAUTHORIZED). - write(char[], int, int) - Method in class org.springframework.mock.web.MockBodyContent
- write(char[], int, int) - Method in class org.springframework.mock.web.MockJspWriter
- write(int) - Method in class org.springframework.mock.web.DelegatingServletOutputStream
- write(String) - Method in class org.springframework.mock.web.MockPart
- writeAndFlushWith(Publisher<? extends Publisher<? extends DataBuffer>>) - Method in class org.springframework.mock.http.client.reactive.MockClientHttpRequest
- writeAndFlushWithInternal(Publisher<? extends Publisher<? extends DataBuffer>>) - Method in class org.springframework.mock.http.server.reactive.MockServerHttpResponse
- writeOut(Writer) - Method in class org.springframework.mock.web.MockBodyContent
- writeWith(Publisher<? extends DataBuffer>) - Method in class org.springframework.mock.http.client.reactive.MockClientHttpRequest
- writeWithInternal(Publisher<? extends DataBuffer>) - Method in class org.springframework.mock.http.server.reactive.MockServerHttpResponse
X
- xml(String) - Method in class org.springframework.test.web.client.match.ContentRequestMatchers
-
Parse the request body and the given String as XML and assert that the two are "similar" - i.e.
- xml(String) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.BodyContentSpec
-
Parse expected and actual response content as XML and assert that the two are "similar", i.e.
- xml(String) - Method in class org.springframework.test.web.servlet.result.ContentResultMatchers
-
Parse the response content and the given string as XML and assert the two are "similar" - i.e.
- XmlExpectationsHelper - Class in org.springframework.test.util
-
A helper class for assertions on XML content.
- XmlExpectationsHelper() - Constructor for class org.springframework.test.util.XmlExpectationsHelper
- xpath(String, Object...) - Static method in class org.springframework.test.web.client.match.MockRestRequestMatchers
-
Access to request body matchers using an XPath to inspect a specific subset of the body.
- xpath(String, Object...) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.BodyContentSpec
-
Access to response body assertions using an XPath expression to inspect a specific subset of the body.
- xpath(String, Object...) - Static method in class org.springframework.test.web.servlet.result.MockMvcResultMatchers
-
Access to response body assertions using an XPath expression to inspect a specific subset of the body.
- xpath(String, Map<String, String>, Object...) - Static method in class org.springframework.test.web.client.match.MockRestRequestMatchers
-
Access to response body matchers using an XPath to inspect a specific subset of the body.
- xpath(String, Map<String, String>, Object...) - Method in interface org.springframework.test.web.reactive.server.WebTestClient.BodyContentSpec
-
Access to response body assertions with specific namespaces using an XPath expression to inspect a specific subset of the body.
- xpath(String, Map<String, String>, Object...) - Static method in class org.springframework.test.web.servlet.result.MockMvcResultMatchers
-
Access to response body assertions using an XPath expression to inspect a specific subset of the body.
- XpathAssertions - Class in org.springframework.test.web.reactive.server
-
XPath assertions for the
WebTestClient
. - XpathExpectationsHelper - Class in org.springframework.test.util
-
A helper class for applying assertions via XPath expressions.
- XpathExpectationsHelper(String, Map<String, String>, Object...) - Constructor for class org.springframework.test.util.XpathExpectationsHelper
-
XpathExpectationsHelper constructor.
- XpathRequestMatchers - Class in org.springframework.test.web.client.match
-
Factory methods for request content
RequestMatcher
implementations that use an XPath expression. - XpathRequestMatchers(String, Map<String, String>, Object...) - Constructor for class org.springframework.test.web.client.match.XpathRequestMatchers
-
Class constructor, not for direct instantiation.
- XpathResultMatchers - Class in org.springframework.test.web.servlet.result
-
Factory for assertions on the response content using XPath expressions.
- XpathResultMatchers(String, Map<String, String>, Object...) - Constructor for class org.springframework.test.web.servlet.result.XpathResultMatchers
-
Protected constructor, not for direct instantiation.
All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form
WebTestClient.Builder.codecs(Consumer)