Package org.springframework.test.web.servlet.client

# Interface MockMvcWebTestClient.MockMvcServerSpec<B extends MockMvcWebTestClient.MockMvcServerSpec<B>>

Type Parameters:
  `B` - a self reference to the builder type

All Known Subinterfaces:
  `MockMvcWebTestClient.ControllerSpec`, `MockMvcWebTestClient.RouterFunctionSpec`

Enclosing interface:
  MockMvcWebTestClient

public static interface MockMvcWebTestClient.MockMvcServerSpec<B extends MockMvcWebTestClient.MockMvcServerSpec<B>>
Base specification for configuring `MockMvc`, and a simple facade around `ConfigurableMockMvcBuilder`.

## Method Summary

Modifier and Type
Method
Description
`<T extends B>
T`
`alwaysExpect(ResultMatcher resultMatcher)`
Define a global expectation that should always be applied to every response.
`<T extends B>
T`
`apply(MockMvcConfigurer configurer)`
Add a `MockMvcConfigurer` that automates MockMvc setup.
`WebTestClient`
`build()`
Shortcut to build the test client.
`WebTestClient.Builder`
`configureClient()`
Proceed to configure and build the test client.
`<T extends B>
T`
`defaultRequest(RequestBuilder requestBuilder)`
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.
`<T extends B>
T`
`dispatcherServletCustomizer(DispatcherServletCustomizer customizer)`
Allow customization of `DispatcherServlet`.
`<T extends B>
T`
`dispatchOptions(boolean dispatchOptions)`
Whether to handle HTTP OPTIONS requests.
`<T extends B>
T`
`filter(Filter filter, String... urlPatterns)`
Add a filter for specific URL patterns.
`<T extends B>
T`
`filters(Filter... filters)`
Add a global filter.

## Method Details

### filters

<T extends B> T filters(Filter... filters)
Add a global filter.

This is delegated to `ConfigurableMockMvcBuilder.addFilters(Filter...)`.

### filter

<T extends B> T filter(Filter filter, String... urlPatterns)
Add a filter for specific URL patterns.

This is delegated to `ConfigurableMockMvcBuilder.addFilter(Filter, String...)`.

### defaultRequest

<T extends B> T defaultRequest(RequestBuilder requestBuilder)
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.

This is delegated to `ConfigurableMockMvcBuilder.defaultRequest(RequestBuilder)`.

### alwaysExpect

<T extends B> T alwaysExpect(ResultMatcher resultMatcher)
Define a global expectation that should always be applied to every response.

This is delegated to `ConfigurableMockMvcBuilder.alwaysExpect(ResultMatcher)`.

### dispatchOptions

<T extends B> T dispatchOptions(boolean dispatchOptions)
Whether to handle HTTP OPTIONS requests.

This is delegated to `ConfigurableMockMvcBuilder.dispatchOptions(boolean)`.

### dispatcherServletCustomizer

<T extends B> T dispatcherServletCustomizer(DispatcherServletCustomizer customizer)
Allow customization of `DispatcherServlet`.

This is delegated to `ConfigurableMockMvcBuilder.addDispatcherServletCustomizer(DispatcherServletCustomizer)`.

### apply

<T extends B> T apply(MockMvcConfigurer configurer)
Add a `MockMvcConfigurer` that automates MockMvc setup.

This is delegated to `ConfigurableMockMvcBuilder.apply(MockMvcConfigurer)`.

### configureClient

WebTestClient.Builder configureClient()
Proceed to configure and build the test client.

### build

WebTestClient build()
Shortcut to build the test client.