Class LocalHostUriTemplateHandler
java.lang.Object
org.springframework.boot.web.client.RootUriTemplateHandler
org.springframework.boot.test.web.client.LocalHostUriTemplateHandler
- All Implemented Interfaces:
UriTemplateHandler
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 Summary
ConstructorDescriptionLocalHostUriTemplateHandler
(Environment environment) Create a newLocalHostUriTemplateHandler
that will generatehttp
URIs using the givenenvironment
to determine the context path and port.LocalHostUriTemplateHandler
(Environment environment, String scheme) Create a newLocalHostUriTemplateHandler
that will generate URIs with the givenscheme
and use the givenenvironment
to determine the context-path and port.LocalHostUriTemplateHandler
(Environment environment, String scheme, UriTemplateHandler handler) Create a newLocalHostUriTemplateHandler
that will generate URIs with the givenscheme
, use the givenenvironment
to determine the context-path and port and delegate to the given templatehandler
. -
Method Summary
Methods inherited from class org.springframework.boot.web.client.RootUriTemplateHandler
addTo, expand, expand, withHandlerWrapper
-
Constructor Details
-
LocalHostUriTemplateHandler
Create a newLocalHostUriTemplateHandler
that will generatehttp
URIs using the givenenvironment
to determine the context path and port.- Parameters:
environment
- the environment used to determine the port
-
LocalHostUriTemplateHandler
Create a newLocalHostUriTemplateHandler
that will generate URIs with the givenscheme
and use the givenenvironment
to 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
-
LocalHostUriTemplateHandler
public LocalHostUriTemplateHandler(Environment environment, String scheme, UriTemplateHandler handler) Create a newLocalHostUriTemplateHandler
that will generate URIs with the givenscheme
, use the givenenvironment
to determine the context-path and port and delegate to the given templatehandler
.- Parameters:
environment
- the environment used to determine the portscheme
- the scheme of the root urihandler
- the delegate handler- Since:
- 2.0.3
-
-
Method Details
-
getRootUri
- Overrides:
getRootUri
in classRootUriTemplateHandler
-