Interface MockMvcWebTestClient.ControllerSpec
- All Superinterfaces:
MockMvcWebTestClient.MockMvcServerSpec<MockMvcWebTestClient.ControllerSpec>
- Enclosing interface:
- MockMvcWebTestClient
MockMvc
to test one or more
controllers directly, and a simple facade around
StandaloneMockMvcBuilder
.-
Method Summary
Modifier and TypeMethodDescriptionasyncRequestTimeout
(long timeout) Specify the timeout value for async execution.Set a ContentNegotiationManager.controllerAdvice
(Object... controllerAdvice) RegisterControllerAdvice
conversionService
(FormattingConversionService conversionService) Provide a conversion service.customArgumentResolvers
(HandlerMethodArgumentResolver... argumentResolvers) Provide custom argument resolvers.Configure factory for a customRequestMappingHandlerMapping
.customReturnValueHandlers
(HandlerMethodReturnValueHandler... handlers) Provide custom return value handlers.flashMapManager
(FlashMapManager flashMapManager) Provide a custom FlashMapManager.handlerExceptionResolvers
(HandlerExceptionResolver... exceptionResolvers) Set the HandlerExceptionResolver types to use.interceptors
(HandlerInterceptor... interceptors) Add global interceptors.localeResolver
(LocaleResolver localeResolver) Provide the LocaleResolver to use.mappedInterceptors
(String[] pathPatterns, HandlerInterceptor... interceptors) Add interceptors for specific patterns.messageConverters
(HttpMessageConverter<?>... messageConverters) Set the message converters to use.patternParser
(PathPatternParser parser) Enable URL path matching with parsedPathPatterns
.placeholderValue
(String name, String value) Configure placeholder values to use.singleView
(View view) Set up a singleViewResolver
with a fixed view.useTrailingSlashPatternMatch
(boolean useTrailingSlashPatternMatch) Deprecated.Provide a customValidator
.viewResolvers
(ViewResolver... resolvers) Set up view resolution.Methods inherited from interface org.springframework.test.web.servlet.client.MockMvcWebTestClient.MockMvcServerSpec
alwaysExpect, apply, build, configureClient, defaultRequest, dispatcherServletCustomizer, dispatchOptions, filter, filters
-
Method Details
-
controllerAdvice
RegisterControllerAdvice
This is delegated to
StandaloneMockMvcBuilder.setControllerAdvice(Object...)
. -
messageConverters
Set the message converters to use.This is delegated to
StandaloneMockMvcBuilder.setMessageConverters(HttpMessageConverter[])
. -
validator
Provide a customValidator
.This is delegated to
StandaloneMockMvcBuilder.setValidator(Validator)
. -
conversionService
MockMvcWebTestClient.ControllerSpec conversionService(FormattingConversionService conversionService) Provide a conversion service.This is delegated to
StandaloneMockMvcBuilder.setConversionService(FormattingConversionService)
. -
interceptors
Add global interceptors.This is delegated to
StandaloneMockMvcBuilder.addInterceptors(HandlerInterceptor...)
. -
mappedInterceptors
MockMvcWebTestClient.ControllerSpec mappedInterceptors(@Nullable String[] pathPatterns, HandlerInterceptor... interceptors) Add interceptors for specific patterns.This is delegated to
StandaloneMockMvcBuilder.addMappedInterceptors(String[], HandlerInterceptor...)
. -
contentNegotiationManager
Set a ContentNegotiationManager.This is delegated to
StandaloneMockMvcBuilder.setContentNegotiationManager(ContentNegotiationManager)
. -
asyncRequestTimeout
Specify the timeout value for async execution.This is delegated to
StandaloneMockMvcBuilder.setAsyncRequestTimeout(long)
. -
customArgumentResolvers
MockMvcWebTestClient.ControllerSpec customArgumentResolvers(HandlerMethodArgumentResolver... argumentResolvers) Provide custom argument resolvers.This is delegated to
StandaloneMockMvcBuilder.setCustomArgumentResolvers(HandlerMethodArgumentResolver...)
. -
customReturnValueHandlers
MockMvcWebTestClient.ControllerSpec customReturnValueHandlers(HandlerMethodReturnValueHandler... handlers) Provide custom return value handlers.This is delegated to
StandaloneMockMvcBuilder.setCustomReturnValueHandlers(HandlerMethodReturnValueHandler...)
. -
handlerExceptionResolvers
MockMvcWebTestClient.ControllerSpec handlerExceptionResolvers(HandlerExceptionResolver... exceptionResolvers) Set the HandlerExceptionResolver types to use.This is delegated to
StandaloneMockMvcBuilder.setHandlerExceptionResolvers(HandlerExceptionResolver...)
. -
viewResolvers
Set up view resolution.This is delegated to
StandaloneMockMvcBuilder.setViewResolvers(ViewResolver...)
. -
singleView
Set up a singleViewResolver
with a fixed view.This is delegated to
StandaloneMockMvcBuilder.setSingleView(View)
. -
localeResolver
Provide the LocaleResolver to use.This is delegated to
StandaloneMockMvcBuilder.setLocaleResolver(LocaleResolver)
. -
flashMapManager
Provide a custom FlashMapManager.This is delegated to
StandaloneMockMvcBuilder.setFlashMapManager(FlashMapManager)
. -
patternParser
Enable URL path matching with parsedPathPatterns
.This is delegated to
StandaloneMockMvcBuilder.setPatternParser(PathPatternParser)
. -
useTrailingSlashPatternMatch
@Deprecated MockMvcWebTestClient.ControllerSpec useTrailingSlashPatternMatch(boolean useTrailingSlashPatternMatch) Deprecated.as of 6.0, seePathPatternParser.setMatchOptionalTrailingSeparator(boolean)
Whether to match trailing slashes.This is delegated to
StandaloneMockMvcBuilder.setUseTrailingSlashPatternMatch(boolean)
. -
placeholderValue
Configure placeholder values to use.This is delegated to
StandaloneMockMvcBuilder.addPlaceholderValue(String, String)
. -
customHandlerMapping
MockMvcWebTestClient.ControllerSpec customHandlerMapping(Supplier<RequestMappingHandlerMapping> factory) Configure factory for a customRequestMappingHandlerMapping
.This is delegated to
StandaloneMockMvcBuilder.setCustomHandlerMapping(Supplier)
.
-
PathPatternParser.setMatchOptionalTrailingSeparator(boolean)