public static interface MockMvcWebTestClient.ControllerSpec extends MockMvcWebTestClient.MockMvcServerSpec<MockMvcWebTestClient.ControllerSpec>
MockMvc
to test one or more
controllers directly, and a simple facade around
StandaloneMockMvcBuilder
.Modifier and Type | Method and Description |
---|---|
MockMvcWebTestClient.ControllerSpec |
asyncRequestTimeout(long timeout)
Specify the timeout value for async execution.
|
MockMvcWebTestClient.ControllerSpec |
contentNegotiationManager(org.springframework.web.accept.ContentNegotiationManager manager)
Set a ContentNegotiationManager.
|
MockMvcWebTestClient.ControllerSpec |
controllerAdvice(Object... controllerAdvice)
Register
org.springframework.web.bind.annotation.ControllerAdvice |
MockMvcWebTestClient.ControllerSpec |
conversionService(org.springframework.format.support.FormattingConversionService conversionService)
Provide a conversion service.
|
MockMvcWebTestClient.ControllerSpec |
customArgumentResolvers(org.springframework.web.method.support.HandlerMethodArgumentResolver... argumentResolvers)
Provide custom argument resolvers.
|
MockMvcWebTestClient.ControllerSpec |
customHandlerMapping(Supplier<org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping> factory)
Configure factory for a custom
RequestMappingHandlerMapping . |
MockMvcWebTestClient.ControllerSpec |
customReturnValueHandlers(org.springframework.web.method.support.HandlerMethodReturnValueHandler... handlers)
Provide custom return value handlers.
|
MockMvcWebTestClient.ControllerSpec |
flashMapManager(org.springframework.web.servlet.FlashMapManager flashMapManager)
Provide a custom FlashMapManager.
|
MockMvcWebTestClient.ControllerSpec |
handlerExceptionResolvers(org.springframework.web.servlet.HandlerExceptionResolver... exceptionResolvers)
Set the HandlerExceptionResolver types to use.
|
MockMvcWebTestClient.ControllerSpec |
interceptors(org.springframework.web.servlet.HandlerInterceptor... interceptors)
Add global interceptors.
|
MockMvcWebTestClient.ControllerSpec |
localeResolver(org.springframework.web.servlet.LocaleResolver localeResolver)
Provide the LocaleResolver to use.
|
MockMvcWebTestClient.ControllerSpec |
mappedInterceptors(String[] pathPatterns,
org.springframework.web.servlet.HandlerInterceptor... interceptors)
Add interceptors for specific patterns.
|
MockMvcWebTestClient.ControllerSpec |
messageConverters(org.springframework.http.converter.HttpMessageConverter<?>... messageConverters)
Set the message converters to use.
|
MockMvcWebTestClient.ControllerSpec |
patternParser(org.springframework.web.util.pattern.PathPatternParser parser)
Enable URL path matching with parsed
PathPatterns . |
MockMvcWebTestClient.ControllerSpec |
placeholderValue(String name,
String value)
Configure placeholder values to use.
|
MockMvcWebTestClient.ControllerSpec |
singleView(org.springframework.web.servlet.View view)
Set up a single
ViewResolver with a fixed view. |
MockMvcWebTestClient.ControllerSpec |
useTrailingSlashPatternMatch(boolean useTrailingSlashPatternMatch)
Whether to match trailing slashes.
|
MockMvcWebTestClient.ControllerSpec |
validator(org.springframework.validation.Validator validator)
Provide a custom
Validator . |
MockMvcWebTestClient.ControllerSpec |
viewResolvers(org.springframework.web.servlet.ViewResolver... resolvers)
Set up view resolution.
|
alwaysExpect, apply, build, configureClient, defaultRequest, dispatcherServletCustomizer, dispatchOptions, filter, filters
MockMvcWebTestClient.ControllerSpec controllerAdvice(Object... controllerAdvice)
org.springframework.web.bind.annotation.ControllerAdvice
This is delegated to
StandaloneMockMvcBuilder.setControllerAdvice(Object...)
.
MockMvcWebTestClient.ControllerSpec messageConverters(org.springframework.http.converter.HttpMessageConverter<?>... messageConverters)
This is delegated to
StandaloneMockMvcBuilder.setMessageConverters(HttpMessageConverter[])
.
MockMvcWebTestClient.ControllerSpec validator(org.springframework.validation.Validator validator)
Validator
.
This is delegated to
StandaloneMockMvcBuilder.setValidator(Validator)
.
MockMvcWebTestClient.ControllerSpec conversionService(org.springframework.format.support.FormattingConversionService conversionService)
This is delegated to
StandaloneMockMvcBuilder.setConversionService(FormattingConversionService)
.
MockMvcWebTestClient.ControllerSpec interceptors(org.springframework.web.servlet.HandlerInterceptor... interceptors)
This is delegated to
StandaloneMockMvcBuilder.addInterceptors(HandlerInterceptor...)
.
MockMvcWebTestClient.ControllerSpec mappedInterceptors(@Nullable String[] pathPatterns, org.springframework.web.servlet.HandlerInterceptor... interceptors)
This is delegated to
StandaloneMockMvcBuilder.addMappedInterceptors(String[], HandlerInterceptor...)
.
MockMvcWebTestClient.ControllerSpec contentNegotiationManager(org.springframework.web.accept.ContentNegotiationManager manager)
This is delegated to
StandaloneMockMvcBuilder.setContentNegotiationManager(ContentNegotiationManager)
.
MockMvcWebTestClient.ControllerSpec asyncRequestTimeout(long timeout)
This is delegated to
StandaloneMockMvcBuilder.setAsyncRequestTimeout(long)
.
MockMvcWebTestClient.ControllerSpec customArgumentResolvers(org.springframework.web.method.support.HandlerMethodArgumentResolver... argumentResolvers)
This is delegated to
StandaloneMockMvcBuilder.setCustomArgumentResolvers(HandlerMethodArgumentResolver...)
.
MockMvcWebTestClient.ControllerSpec customReturnValueHandlers(org.springframework.web.method.support.HandlerMethodReturnValueHandler... handlers)
This is delegated to
StandaloneMockMvcBuilder.setCustomReturnValueHandlers(HandlerMethodReturnValueHandler...)
.
MockMvcWebTestClient.ControllerSpec handlerExceptionResolvers(org.springframework.web.servlet.HandlerExceptionResolver... exceptionResolvers)
This is delegated to
StandaloneMockMvcBuilder.setHandlerExceptionResolvers(HandlerExceptionResolver...)
.
MockMvcWebTestClient.ControllerSpec viewResolvers(org.springframework.web.servlet.ViewResolver... resolvers)
This is delegated to
StandaloneMockMvcBuilder.setViewResolvers(ViewResolver...)
.
MockMvcWebTestClient.ControllerSpec singleView(org.springframework.web.servlet.View view)
ViewResolver
with a fixed view.
This is delegated to
StandaloneMockMvcBuilder.setSingleView(View)
.
MockMvcWebTestClient.ControllerSpec localeResolver(org.springframework.web.servlet.LocaleResolver localeResolver)
This is delegated to
StandaloneMockMvcBuilder.setLocaleResolver(LocaleResolver)
.
MockMvcWebTestClient.ControllerSpec flashMapManager(org.springframework.web.servlet.FlashMapManager flashMapManager)
This is delegated to
StandaloneMockMvcBuilder.setFlashMapManager(FlashMapManager)
.
MockMvcWebTestClient.ControllerSpec patternParser(org.springframework.web.util.pattern.PathPatternParser parser)
PathPatterns
.
This is delegated to
StandaloneMockMvcBuilder.setPatternParser(PathPatternParser)
.
MockMvcWebTestClient.ControllerSpec useTrailingSlashPatternMatch(boolean useTrailingSlashPatternMatch)
This is delegated to
StandaloneMockMvcBuilder.setUseTrailingSlashPatternMatch(boolean)
.
MockMvcWebTestClient.ControllerSpec placeholderValue(String name, String value)
This is delegated to
StandaloneMockMvcBuilder.addPlaceholderValue(String, String)
.
MockMvcWebTestClient.ControllerSpec customHandlerMapping(Supplier<org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping> factory)
RequestMappingHandlerMapping
.
This is delegated to
StandaloneMockMvcBuilder.setCustomHandlerMapping(Supplier)
.