Class 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 Details

  • Method Details

    • withScheme

      public UriConfigurer withScheme(String scheme)
      Configures any documented URIs to use the given scheme. The default is http.
      Parameters:
      scheme - the URI scheme
      Returns:
      this
    • withHost

      public UriConfigurer withHost(String host)
      Configures any documented URIs to use the given host. The default is localhost.
      Parameters:
      host - the URI host
      Returns:
      this
    • withPort

      public UriConfigurer withPort(int port)
      Configures any documented URIs to use the given port. The default is 8080.
      Parameters:
      port - the URI port
      Returns:
      this
    • apply

      public void apply(Map<String,Object> configuration, RestDocumentationContext context)
      Description copied from class: AbstractConfigurer
      Applies the configurer to the given configuration.
      Specified by:
      apply in class AbstractConfigurer
      Parameters:
      configuration - the configuration to be configured
      context - the current documentation context
    • afterConfigurerAdded

      public void afterConfigurerAdded(org.springframework.test.web.servlet.setup.ConfigurableMockMvcBuilder<?> builder)
      Specified by:
      afterConfigurerAdded in interface org.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:
      beforeMockMvcCreated in interface org.springframework.test.web.servlet.setup.MockMvcConfigurer