Class UriConfigurer
java.lang.Object
org.springframework.restdocs.config.AbstractConfigurer
org.springframework.restdocs.config.AbstractNestedConfigurer<MockMvcRestDocumentationConfigurer>
org.springframework.restdocs.mockmvc.UriConfigurer
- All Implemented Interfaces:
org.springframework.test.web.servlet.setup.MockMvcConfigurer
public class UriConfigurer
extends AbstractNestedConfigurer<MockMvcRestDocumentationConfigurer>
implements org.springframework.test.web.servlet.setup.MockMvcConfigurer
A configurer that can be used to configure the documented URIs.
- Author:
- Andy Wilkinson
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidafterConfigurerAdded(org.springframework.test.web.servlet.setup.ConfigurableMockMvcBuilder<?> builder) voidapply(Map<String, Object> configuration, RestDocumentationContext context) Applies the configurer to the givenconfiguration.org.springframework.test.web.servlet.request.RequestPostProcessorbeforeMockMvcCreated(org.springframework.test.web.servlet.setup.ConfigurableMockMvcBuilder<?> builder, org.springframework.web.context.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
Description copied from class:AbstractConfigurerApplies the configurer to the givenconfiguration.- Specified by:
applyin classAbstractConfigurer- Parameters:
configuration- the configuration to be configuredcontext- the current documentation context
-
afterConfigurerAdded
public void afterConfigurerAdded(org.springframework.test.web.servlet.setup.ConfigurableMockMvcBuilder<?> builder) - Specified by:
afterConfigurerAddedin interfaceorg.springframework.test.web.servlet.setup.MockMvcConfigurer
-
beforeMockMvcCreated
public org.springframework.test.web.servlet.request.RequestPostProcessor beforeMockMvcCreated(org.springframework.test.web.servlet.setup.ConfigurableMockMvcBuilder<?> builder, org.springframework.web.context.WebApplicationContext context) - Specified by:
beforeMockMvcCreatedin interfaceorg.springframework.test.web.servlet.setup.MockMvcConfigurer
-