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.
  • Constructor Details

    • MockDatastoreFactory

      public MockDatastoreFactory()
  • Method Details

    • 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 class DatastoreFactory
    • getLastPath

      public String getLastPath()
    • getLastMimeType

      public String getLastMimeType()
    • getLastApiFormatHeaderValue

      public String getLastApiFormatHeaderValue()
    • getLastBody

      public byte[] getLastBody()
    • getLastCookies

      public List<String> getLastCookies()