Package (2.4.0)

A testing helper for Google Cloud Datastore.

A simple usage example:

Before the test:

 LocalDatastoreHelper helper = LocalDatastoreHelper.create();
 Datastore localDatastore = helper.getOptions().getService();

After the test:


See Also: Google Cloud Java tools for testing



Utility to start and stop local Google Cloud Datastore emulators.

This class is unstable.


A builder for LocalDatastoreHelper objects.


Utility to create a remote datastore configuration for testing. Datastore options can be obtained via the #getOptions() method. Returned options use a randomly generated namespace (DatastoreOptions#getNamespace()) that can be used to run the tests. Once the tests are run, all entities in the namespace can be deleted using #deleteNamespace(). Returned options also have custom DatastoreOptions#getRetrySettings(): RetrySettings#getMaxAttempts() is 10, RetrySettings#getMaxRetryDelay() is 30000, RetrySettings#getTotalTimeout() is 120000 and RetrySettings#getInitialRetryDelay() is 250. HttpTransportOptions#getConnectTimeout() and HttpTransportOptions#getReadTimeout() are both both set to 60000.

Internal testing use only