How to test application integration with Google Cloud Storage?

Viewed 1227

I have an application that's integrated with Google Cloud Storage. I need to write some unit/integration tests to test my application with Google Cloud Storage.

I found a MockGoogleCredential class for Java that simulates the credentials provider, but I could not find any code examples. Has anyone used this before?

1 Answers

The gsutil test command explained here can be used to run the gsutil unit tests and integration tests. The unit tests use an in-memory mock storage service implementation, while the integration tests send requests to the production service using the preferred API set in the boto configuration file, view gsutil help apis for more details.

In addition, I came across Google In-Memory emulator, but according to some Stackoverflow posts this has been moved to here.

There are also some non-official options been developed, such as this one which you could use for stubbing/mocking Google Cloud Storage as a standalone server.

Finally, while navigating through related GitHub Feature Requests, I came across this unofficial library which includes integration tests and supports GCS, according to this GitHub issue.

Related