public class TestPortProvider extends Object
Constructor and Description |
---|
TestPortProvider() |
Modifier and Type | Method and Description |
---|---|
static ClientRequest |
createClientRequest(ClientRequestFactory factory,
String path) |
static ClientRequest |
createClientRequest(String path)
Create a Resteasy ClientRequest object using the configured port.
|
static <T> T |
createProxy(Class<T> clazz)
Create a Resteasy client proxy with an empty base request path.
|
static <T> T |
createProxy(Class<T> clazz,
String path)
Create a Resteasy client proxy.
|
static URI |
createURI(String path)
Create a URI for the provided path, using the configured port
|
static URL |
createURL(String path)
Create a URL for the provided path, using the configured port
|
static String |
generateBaseUrl()
Generate a base URL incorporating the configured port.
|
static String |
generateURL(String path)
Generate a URL incorporating the configured port.
|
static String |
getHost()
Look up the configured hostname, first checking an environment variable (RESTEASY_HOST),
then a system property (org.jboss.resteasy.host), and finally the default hostname (localhost).
|
static int |
getPort()
Look up the configured port number, first checking an environment variable (RESTEASY_PORT),
then a system property (org.jboss.resteasy.port), and finally the default port (8081).
|
public static ClientRequest createClientRequest(String path)
path
- the request pathpublic static ClientRequest createClientRequest(ClientRequestFactory factory, String path)
public static <T> T createProxy(Class<T> clazz)
T
- typeclazz
- the client interface classpublic static <T> T createProxy(Class<T> clazz, String path)
T
- typeclazz
- the client interface classpath
- the base request pathpublic static URI createURI(String path)
path
- the request pathpublic static URL createURL(String path) throws MalformedURLException
path
- the request pathMalformedURLException
- if no protocol is specified or an unknown protocol is foundpublic static String generateBaseUrl()
public static String generateURL(String path)
path
- the pathpublic static int getPort()
public static String getHost()
Copyright © 2020 JBoss by Red Hat. All rights reserved.