Class UriConfigurer
java.lang.Object
org.springframework.restdocs.config.AbstractConfigurer
org.springframework.restdocs.config.AbstractNestedConfigurer<MockMvcRestDocumentationConfigurer>
org.springframework.restdocs.mockmvc.UriConfigurer
- All Implemented Interfaces:
MockMvcConfigurer
public class UriConfigurer
extends org.springframework.restdocs.config.AbstractNestedConfigurer<MockMvcRestDocumentationConfigurer>
implements MockMvcConfigurer
A configurer that can be used to configure the documented URIs.
- Author:
- Andy Wilkinson
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterConfigurerAdded
(ConfigurableMockMvcBuilder<?> builder) void
apply
(Map<String, Object> configuration, org.springframework.restdocs.RestDocumentationContext context) beforeMockMvcCreated
(ConfigurableMockMvcBuilder<?> builder, WebApplicationContext context) Configures any documented URIs to use the givenhost
.withPort
(int port) Configures any documented URIs to use the givenport
.withScheme
(String scheme) Configures any documented URIs to use the givenscheme
.Methods inherited from class org.springframework.restdocs.config.AbstractNestedConfigurer
and
-
Field Details
-
DEFAULT_SCHEME
The default scheme for documented URIs.- See Also:
-
DEFAULT_HOST
The defalt host for documented URIs.- See Also:
-
DEFAULT_PORT
public static final int DEFAULT_PORTThe default port for documented URIs.- See Also:
-
-
Method Details
-
withScheme
Configures any documented URIs to use the givenscheme
. The default ishttp
.- Parameters:
scheme
- the URI scheme- Returns:
this
-
withHost
Configures any documented URIs to use the givenhost
. The default islocalhost
.- Parameters:
host
- the URI host- Returns:
this
-
withPort
Configures any documented URIs to use the givenport
. The default is8080
.- Parameters:
port
- the URI port- Returns:
this
-
apply
public void apply(Map<String, Object> configuration, org.springframework.restdocs.RestDocumentationContext context) - Specified by:
apply
in classorg.springframework.restdocs.config.AbstractConfigurer
-
afterConfigurerAdded
- Specified by:
afterConfigurerAdded
in interfaceMockMvcConfigurer
-
beforeMockMvcCreated
public RequestPostProcessor beforeMockMvcCreated(ConfigurableMockMvcBuilder<?> builder, WebApplicationContext context) - Specified by:
beforeMockMvcCreated
in interfaceMockMvcConfigurer
-