Repository navigation
feat: Make the test container a Testcontainers container, and let it hand out a client with options. - #13
Merged
Conversation
…hand out a client with options. Container wrapped a GenericContainer, so it did not work where frameworks expect a Testcontainers container, e.g. with @Serviceconnection in Spring Boot. It now extends GenericContainer, as the official modules of Testcontainers do. All of its methods keep their names and their behavior, including replacing a container whose database does not become reachable. It also works in a try-with-resources statement now. getClient(ClientOptions) hands out a client with options of the caller, so that tests can use the same data mapper as production. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hc2MPSLu7HDHTm8HiBsrDz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Containerwrapped aGenericContainer, so it did not work where frameworks expect a Testcontainers container. Spring Boot's@ServiceConnection, which the upcoming starter builds on, is one of them.What changes:
ContainerextendsGenericContainer, as the official modules of Testcontainers do.try-with-resources statement, and wherever else Testcontainers containers work.getClient(ClientOptions)hands out a client with options of the caller, so that tests can use the same data mapper as production.This is the first of two PRs for the Spring Boot integration. The second adds the starter.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Hc2MPSLu7HDHTm8HiBsrDz