Skip to content

feat: Make the test container a Testcontainers container, and let it hand out a client with options. - #13

Merged
goloroden merged 1 commit into
mainfrom
extend-generic-container
Oct 8, 2026
Merged

goloroden merged 1 commit into
mainfrom
extend-generic-container

Conversation

@goloroden

Copy link
Copy Markdown
Member

Container wrapped a GenericContainer, 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:

  • Container extends GenericContainer, as the official modules of Testcontainers do.
  • All of its methods keep their names and their behavior. That includes replacing a container whose database does not become reachable, and reporting what it does not have, e.g. the host before it runs.
  • It now also works in a 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.
  • The README mentions both.

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

…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
@goloroden
goloroden requested a review from a team as a code owner October 8, 2026 15:36
@goloroden goloroden self-assigned this Oct 8, 2026
@goloroden
goloroden merged commit f908722 into main Oct 8, 2026
2 checks passed
@goloroden
goloroden deleted the extend-generic-container branch October 8, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant