Class MockDatastoreFactory
- java.lang.Object
-
- com.google.datastore.v1.client.DatastoreFactory
-
- com.google.datastore.v1.client.testing.MockDatastoreFactory
-
public class MockDatastoreFactory extends DatastoreFactory
Fake Datastore factory used for testing purposes when a true Datastore service is not needed.
-
-
Field Summary
-
Fields inherited from class com.google.datastore.v1.client.DatastoreFactory
DEFAULT_HOST, VERSION
-
-
Constructor Summary
Constructors Constructor Description MockDatastoreFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getLastApiFormatHeaderValue()
byte[]
getLastBody()
List<String>
getLastCookies()
String
getLastMimeType()
String
getLastPath()
com.google.api.client.http.HttpRequestFactory
makeClient(DatastoreOptions options)
Constructs a Google APIs HTTP client with the associated credentials.void
setNextError(int status, com.google.rpc.Code code, String message)
void
setNextException(IOException exception)
void
setNextResponse(com.google.protobuf.Message response)
-
Methods inherited from class com.google.datastore.v1.client.DatastoreFactory
create, get, logMethodCalls, newRemoteRpc
-
-
-
-
Method Detail
-
setNextResponse
public void setNextResponse(com.google.protobuf.Message response)
-
setNextError
public void setNextError(int status, com.google.rpc.Code code, String message)
-
setNextException
public void setNextException(IOException exception)
-
makeClient
public com.google.api.client.http.HttpRequestFactory makeClient(DatastoreOptions options)
Description copied from class:DatastoreFactory
Constructs a Google APIs HTTP client with the associated credentials.- Overrides:
makeClient
in classDatastoreFactory
-
getLastPath
public String getLastPath()
-
getLastMimeType
public String getLastMimeType()
-
getLastApiFormatHeaderValue
public String getLastApiFormatHeaderValue()
-
getLastBody
public byte[] getLastBody()
-
-