Skip to content

Conversation

@papa-piton-2256
Copy link

Motivation

This PR implements the static getR2dbcUrl() helper method for the MySQL module, as requested by @eddumelendez in issue #8797.

Currently, users working with R2DBC drivers have to manually construct connection strings, which is error-prone and verbose. This helper provides a standardized way to obtain a valid R2DBC URL from a running MySQLContainer.

Changes

  • Added public static String getR2dbcUrl(MySQLContainer<?> container) to MySQLR2DBCDatabaseContainer.
  • Returns a formatted string: r2dbc:mysql://<user>:<password>@<host>:<port>/<db>.

Verification

  • Ran ./gradlew :testcontainers-mysql:test locally.
  • Verified that the code style complies with Spotless.

Fixes #8797
Supersedes #9569 (inactive)

@papa-piton-2256 papa-piton-2256 force-pushed the feat/mysql-r2dbc-helper branch from 679d9a3 to 712d13a Compare December 3, 2025 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add getR2dbcUrl helper method to JdbcDatabaseContainer

1 participant