Skip to content

Commit 6433278

Browse files
committed
Add getR2dbcurl to interface
1 parent 10cc854 commit 6433278

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

modules/r2dbc/src/main/java/org/testcontainers/r2dbc/R2DBCDatabaseContainer.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,17 @@
55

66
public interface R2DBCDatabaseContainer extends Startable {
77
ConnectionFactoryOptions configure(ConnectionFactoryOptions options);
8+
9+
/**
10+
* Returns the R2DBC URL for connecting to the database.
11+
* <p>
12+
* The default implementation throws {@link UnsupportedOperationException}.
13+
* Implementations should override this method to provide the actual R2DBC URL.
14+
*
15+
* @return the R2DBC URL in the format: r2dbc:driver://username:password@host:port/database
16+
* @throws UnsupportedOperationException if the implementation does not support R2DBC URLs
17+
*/
18+
default String getR2dbcUrl() {
19+
throw new UnsupportedOperationException("R2DBC URL is not supported by this container");
20+
}
821
}

0 commit comments

Comments
 (0)