| Constructor and Description |
|---|
FakeDns() |
| Modifier and Type | Method and Description |
|---|---|
List<InetAddress> |
allocate(int count)
Allocates and returns
count fake addresses like [255.0.0.100, 255.0.0.101]. |
void |
assertRequests(String... expectedHosts) |
FakeDns |
clear(String hostname)
Clears the results for
hostname. |
List<InetAddress> |
lookup(String hostname)
Returns the IP addresses of
hostname, in the order they will be attempted by OkHttp. |
InetAddress |
lookup(String hostname,
int index) |
FakeDns |
set(String hostname,
List<InetAddress> addresses)
Sets the results for
hostname. |
public FakeDns set(String hostname, List<InetAddress> addresses)
hostname.public InetAddress lookup(String hostname, int index) throws UnknownHostException
UnknownHostExceptionpublic List<InetAddress> lookup(String hostname) throws UnknownHostException
Dnshostname, in the order they will be attempted by OkHttp. If
a connection to an address fails, OkHttp will retry the connection with the next address until
either a connection is made, the set of IP addresses is exhausted, or a limit is exceeded.lookup in interface DnsUnknownHostExceptionpublic void assertRequests(String... expectedHosts)
public List<InetAddress> allocate(int count)
count fake addresses like [255.0.0.100, 255.0.0.101].Copyright © 2017. All Rights Reserved.