Is your feature request related to a problem? Please describe.
Spring Boot 3.1 introduces Service Connections which can be used with Testcontainers in order to reduce the boilerplate code to setup Datastore, Firestore, PubSub, Spanner for testing
From:
@Container
private static final SpannerEmulatorContainer spannerEmulator =
new SpannerEmulatorContainer(
DockerImageName.parse("gcr.io/cloud-spanner-emulator/emulator:1.1.1"));
@DynamicPropertySource
static void emulatorProperties(DynamicPropertyRegistry registry) {
registry.add(
"spring.cloud.gcp.spanner.emulator-host", spannerEmulator::getEmulatorGrpcEndpoint);
}
To:
@Container
@ServiceConnection
private static final SpannerEmulatorContainer spannerEmulator =
new SpannerEmulatorContainer(
DockerImageName.parse("gcr.io/cloud-spanner-emulator/emulator:1.1.1"));
Describe the solution you'd like
Provide support for Service Connections for Datastore, Firestore, PubSub and Spanner
Describe alternatives you've considered
Still using the same approach or implement my own.
Additional contextHere you can see what is needed in order to make this happen. I've already contributed to spring boot and also to spring-cloud-gcp. So, I would be glad to contribute if this is accepted.
Hi @meltsufin
The three of them are about improve the experience but are not strictly related. Although #1245 can benefit from this one. #159 is about properties alignment
Is your feature request related to a problem? Please describe. Spring Boot 3.1 introduces Service Connections which can be used with Testcontainers in order to reduce the boilerplate code to setup Datastore, Firestore, PubSub, Spanner for testing
From:
To:
There is also benefits about using it at development time.
Describe the solution you'd like Provide support for Service Connections for Datastore, Firestore, PubSub and Spanner
Describe alternatives you've considered Still using the same approach or implement my own.
Additional context Here you can see what is needed in order to make this happen. I've already contributed to spring boot and also to spring-cloud-gcp. So, I would be glad to contribute if this is accepted.