testcontainers-java
testcontainers-java copied to clipboard
Add getR2dbcUrl() to MariaDBR2DBCDatabaseContainer
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)toMariaDBR2DBCDatabaseContainer. - Added test case to verify the URL format and parameters.
Verification
- Ran
./gradlew :testcontainers-mariadb:testand verified that tests pass. - Verified code style with Spotless.
Relates to #8797