org.springframework.boot.test.web.client

Class LocalHostUriTemplateHandler

  • All Implemented Interfaces:
    UriTemplateHandler


    public class LocalHostUriTemplateHandler
    extends RootUriTemplateHandler
    UriTemplateHandler will automatically prefix relative URIs with localhost:${local.server.port}.
    Since:
    1.4.0
    Author:
    Phillip Webb, Andy Wilkinson, EddĂș MelĂ©ndez, Madhura Bhave
    • Constructor Detail

      • LocalHostUriTemplateHandler

        public LocalHostUriTemplateHandler(Environment environment)
        Create a new LocalHostUriTemplateHandler that will generate http URIs using the given environment to determine the context path and port.
        Parameters:
        environment - the environment used to determine the port
      • LocalHostUriTemplateHandler

        public LocalHostUriTemplateHandler(Environment environment,
                                           String scheme)
        Create a new LocalHostUriTemplateHandler that will generate URIs with the given scheme and use the given environment to determine the context-path and port.
        Parameters:
        environment - the environment used to determine the port
        scheme - the scheme of the root uri
        Since:
        1.4.1
      • LocalHostUriTemplateHandler

        public LocalHostUriTemplateHandler(Environment environment,
                                           String scheme,
                                           UriTemplateHandler handler)
        Create a new LocalHostUriTemplateHandler that will generate URIs with the given scheme, use the given environment to determine the context-path and port and delegate to the given template handler.
        Parameters:
        environment - the environment used to determine the port
        scheme - the scheme of the root uri
        handler - the delegate handler
        Since:
        2.0.3