public class ExternalServiceUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
canonicalLocalHostname
A local address created based on a direct IP address like 127.0.0.1 can result
in a reverse-lookup for hostname in something different than "localhost".
|
| Constructor and Description |
|---|
ExternalServiceUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
analyzeDnsResolution(String host)
Force collecting DNS info, without failing if errors
|
static String[] |
collectExternalServiceInfo(ExternalServiceInfo remoteHostInfo,
int remotePort)
If there is a mock server assigned for the given hostname,
core will try to check the active status and if not active it will
update the respective port and initiate the server.
|
static URL |
getReplacedURL(URL url) |
static int |
inferPort(int port,
String protocol)
Unless the port number is specified in a URL, the default will be -1.
|
static boolean |
isValidIP(String s)
Check if string literal is a valid v4 or v6 IP address
|
static boolean |
skipHostname(String hostname) |
static boolean |
skipHostnameOrIp(String hostname)
skip method replacement for some hostname.
|
public static final String canonicalLocalHostname
public static boolean isValidIP(String s)
public static void analyzeDnsResolution(String host)
public static String[] collectExternalServiceInfo(ExternalServiceInfo remoteHostInfo, int remotePort)
remoteHostInfo - is the host info collected from the SUTremotePort - is the port employed by the SUTpublic static boolean skipHostnameOrIp(String hostname)
public static boolean skipHostname(String hostname)
public static int inferPort(int port,
String protocol)
port - protocol - Copyright © 2016–2024. All rights reserved.