Testcontainers wrapper for https://github.com/fsouza/fake-gcs-server.
- Add the dependency:
<dependency>
<groupId>io.aiven</groupId>
<artifactId>testcontainers-fake-gcs-server</artifactId>
<version>0.1.0</version>
</dependency>
- Use in tests with JUnit 5 and Testcontainers:
@Testcontainers
class MyTest {
@Container
private static final FakeGcsServerContainer FAKE_GCS_SERVER_CONTAINER =
new FakeGcsServerContainer();
@Test
void test() {
final Storage storage = StorageOptions.newBuilder()
.setCredentials(NoCredentials.getInstance())
.setHost(FAKE_GCS_SERVER_CONTAINER.url())
.setProjectId("test-project")
.build()
.getService();
storage.create(BucketInfo.of("test-bucket"));
}
}
testcontainers-fake-gcs-server
is licensed under the Apache license, version 2.0. Full license text is available in the LICENSE file.
Please note that the project explicitly does not require a CLA (Contributor License Agreement) from its contributors.
Bug reports and patches are very welcome, please post them as GitHub issues and pull requests at https://github.com/Aiven-Open/testcontainers-fake-gcs-server. To report any possible vulnerabilities or other serious issues please see our security policy.