testcontainers-java icon indicating copy to clipboard operation
testcontainers-java copied to clipboard

Add getR2dbcUrl() to MariaDBR2DBCDatabaseContainer

Open taole33 opened this issue 5 days ago • 0 comments

Motivation

This PR implements the static getR2dbcUrl() helper method for the MariaDB module, as discussed in #8797.

This implementation follows the static method approach suggested by @eddumelendez in the issue comments (instead of adding it to the interface), ensuring discoverability without breaking changes.

Currently, users have to manually construct connection strings. This helper provides a standardized way to obtain a valid R2DBC URL.

Changes

  • Added public static String getR2dbcUrl(MariaDBContainer<?> container) to MariaDBR2DBCDatabaseContainer.
  • Added test case to verify the URL format and parameters.

Verification

  • Ran ./gradlew :testcontainers-mariadb:test and verified that tests pass.
  • Verified code style with Spotless.

Relates to #8797

taole33 avatar Dec 09 '25 10:12 taole33