public class LocalDnsHelper extends Object
The mock runs in a separate thread, listening for HTTP requests on the local machine at an ephemeral port.
While the mock attempts to simulate the service, there are some differences in the behaviour. The mock will accept any project ID and never returns a notFound or another error because of project ID. It assumes that all project IDs exist and that the user has all the necessary privileges to manipulate any project. Similarly, the local simulation does not require verification of domain name ownership. Any request for creating a managed zone will be approved. The mock does not track quota and will allow the user to exceed it. The mock provides only basic validation of the DNS data for record sets of type A and AAAA. It does not validate any other record set types.
| Modifier and Type | Method and Description |
|---|---|
static LocalDnsHelper |
create(Long delay)
Creates new
LocalDnsHelper instance that listens to requests on the local machine. |
DnsOptions |
options()
Returns a
DnsOptions instance that sets the host to use the mock server. |
void |
start()
Starts the thread that runs the local DNS server.
|
void |
stop()
Stops the thread that runs the mock DNS server.
|
public static LocalDnsHelper create(Long delay)
LocalDnsHelper instance that listens to requests on the local machine. This
instance processes changes in separate thread. The parameter determines how long a thread
should wait before processing a change. If it is set to 0, the threading is turned off and the
mock will behave synchronously.delay - delay for processing changes in ms or 0 for synchronous processingpublic DnsOptions options()
DnsOptions instance that sets the host to use the mock server.public void start()
public void stop()
Copyright © 2016 Google. All rights reserved.