Class LocalHostUriTemplateHandler
- java.lang.Object
- org.springframework.boot.web.client.RootUriTemplateHandler
- org.springframework.boot.test.web.client.LocalHostUriTemplateHandler
- All Implemented Interfaces:
org.springframework.web.util.UriTemplateHandler
public class LocalHostUriTemplateHandler extends org.springframework.boot.web.client.RootUriTemplateHandler
UriTemplateHandlerwill automatically prefix relative URIs withlocalhost:${local.server.port}.- Since:
- 1.4.0
Constructor Summary
Constructors Constructor Description LocalHostUriTemplateHandler(org.springframework.core.env.Environment environment)Create a newLocalHostUriTemplateHandlerthat will generatehttpURIs using the givenenvironmentto determine the context path and port.LocalHostUriTemplateHandler(org.springframework.core.env.Environment environment, String scheme)Create a newLocalHostUriTemplateHandlerthat will generate URIs with the givenschemeand use the givenenvironmentto determine the context-path and port.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetRootUri()
Constructor Detail
LocalHostUriTemplateHandler
public LocalHostUriTemplateHandler(org.springframework.core.env.Environment environment)
Create a newLocalHostUriTemplateHandlerthat will generatehttpURIs using the givenenvironmentto determine the context path and port.- Parameters:
environment- the environment used to determine the port
LocalHostUriTemplateHandler
public LocalHostUriTemplateHandler(org.springframework.core.env.Environment environment, String scheme)
Create a newLocalHostUriTemplateHandlerthat will generate URIs with the givenschemeand use the givenenvironmentto determine the context-path and port.- Parameters:
environment- the environment used to determine the portscheme- the scheme of the root uri- Since:
- 1.4.1
Method Detail
getRootUri
public String getRootUri()
- Overrides:
getRootUriin classorg.springframework.boot.web.client.RootUriTemplateHandler