Package | Description |
---|---|
org.springframework.test.web.servlet.setup |
Contains built-in
MockMvcBuilder implementations. |
Modifier and Type | Method and Description |
---|---|
StandaloneMockMvcBuilder |
StandaloneMockMvcBuilder.addInterceptors(HandlerInterceptor... interceptors)
Add interceptors mapped to all incoming requests.
|
StandaloneMockMvcBuilder |
StandaloneMockMvcBuilder.addMappedInterceptors(String[] pathPatterns,
HandlerInterceptor... interceptors)
Add interceptors mapped to a set of path patterns.
|
StandaloneMockMvcBuilder |
StandaloneMockMvcBuilder.addPlaceholderValue(String name,
String value)
In a standalone setup there is no support for placeholder values embedded in
request mappings.
|
StandaloneMockMvcBuilder |
StandaloneMockMvcBuilder.setAsyncRequestTimeout(long timeout)
Specify the timeout value for async execution.
|
StandaloneMockMvcBuilder |
StandaloneMockMvcBuilder.setContentNegotiationManager(ContentNegotiationManager manager)
Set a ContentNegotiationManager.
|
StandaloneMockMvcBuilder |
StandaloneMockMvcBuilder.setControllerAdvice(Object... controllerAdvice)
Register one or more
ControllerAdvice
instances to be used in tests (specified Class will be turned into instance). |
StandaloneMockMvcBuilder |
StandaloneMockMvcBuilder.setConversionService(FormattingConversionService conversionService)
Provide a conversion service with custom formatters and converters.
|
StandaloneMockMvcBuilder |
StandaloneMockMvcBuilder.setCustomArgumentResolvers(HandlerMethodArgumentResolver... argumentResolvers)
Provide custom resolvers for controller method arguments.
|
StandaloneMockMvcBuilder |
StandaloneMockMvcBuilder.setCustomHandlerMapping(Supplier<RequestMappingHandlerMapping> factory)
Configure factory to create a custom
RequestMappingHandlerMapping . |
StandaloneMockMvcBuilder |
StandaloneMockMvcBuilder.setCustomReturnValueHandlers(HandlerMethodReturnValueHandler... handlers)
Provide custom handlers for controller method return values.
|
StandaloneMockMvcBuilder |
StandaloneMockMvcBuilder.setFlashMapManager(FlashMapManager flashMapManager)
Provide a custom FlashMapManager instance.
|
StandaloneMockMvcBuilder |
StandaloneMockMvcBuilder.setHandlerExceptionResolvers(HandlerExceptionResolver... exceptionResolvers)
Set the HandlerExceptionResolver types to use as an array.
|
StandaloneMockMvcBuilder |
StandaloneMockMvcBuilder.setHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers)
Set the HandlerExceptionResolver types to use as a list.
|
StandaloneMockMvcBuilder |
StandaloneMockMvcBuilder.setLocaleResolver(LocaleResolver localeResolver)
Provide a LocaleResolver instance.
|
StandaloneMockMvcBuilder |
StandaloneMockMvcBuilder.setMessageConverters(HttpMessageConverter<?>... messageConverters)
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.
|
StandaloneMockMvcBuilder |
StandaloneMockMvcBuilder.setRemoveSemicolonContent(boolean removeSemicolonContent)
Set if ";" (semicolon) content should be stripped from the request URI.
|
StandaloneMockMvcBuilder |
StandaloneMockMvcBuilder.setSingleView(View view)
Sets up a single
ViewResolver that always returns the provided
view instance. |
StandaloneMockMvcBuilder |
StandaloneMockMvcBuilder.setUseSuffixPatternMatch(boolean useSuffixPatternMatch)
Deprecated.
as of 5.2.4. See class-level note in
RequestMappingHandlerMapping on the deprecation of path extension
config options. |
StandaloneMockMvcBuilder |
StandaloneMockMvcBuilder.setUseTrailingSlashPatternMatch(boolean useTrailingSlashPatternMatch)
Whether to match to URLs irrespective of the presence of a trailing slash.
|
StandaloneMockMvcBuilder |
StandaloneMockMvcBuilder.setValidator(Validator validator)
Provide a custom
Validator instead of the one created by default. |
StandaloneMockMvcBuilder |
StandaloneMockMvcBuilder.setViewResolvers(ViewResolver... resolvers)
Set up view resolution with the given
ViewResolvers . |
static StandaloneMockMvcBuilder |
MockMvcBuilders.standaloneSetup(Object... controllers)
Build a
MockMvc instance by registering one or more
@Controller instances and configuring Spring MVC infrastructure
programmatically. |