-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JdbcDatabaseContainer. constructUrlForConnection() returning malformed URLs #1976
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this is a mistake, please reply to this comment to keep it open. If there isn't one already, a PR to fix or at least reproduce the problem in a test case will always help us get back on track to tackle this. |
This issue has been automatically closed due to inactivity. We apologise if this is still an active problem for you, and would ask you to re-open the issue if this is the case. |
Please re-open |
This was released in https://github.com/testcontainers/testcontainers-java/releases/tag/1.14.0 🎉 Thanks for the contribution! |
…stcontainers#1976) (testcontainers#2049) * Reproduce testcontainers#1976 in tests * Override constructUrlForConnection for PostgreSQLContainer * Lighten PostgreSQLConnectionURLTest * Lighten PostgreSQLConnectionURLTest * Cater for base URLs without query strings
JdbcDatabaseContainer. constructUrlForConnection() is a simple method that concatenates JDBC URL and a query string starting with
?
.testcontainers-java/modules/jdbc/src/main/java/org/testcontainers/containers/JdbcDatabaseContainer.java
Lines 222 to 224 in d3ba842
But
PostgreSQLContainer. getJdbcUrl ()
returns a JDBC URL with the query string?loggerLevel=OFF
(The change was introduced from this PR: https://github.com/testcontainers/testcontainers-java/pull/1434/files#diff-d62130004eb8d994f60b87f95b1488be)testcontainers-java/modules/postgresql/src/main/java/org/testcontainers/containers/PostgreSQLContainer.java
Line 62 in d3ba842
This returns invalid URLs for
PostgreSQLContainer
s with custom parameters. For example, given the following URL:jdbc:tc:fevopostgresql:9.6.11://hostname/databasename?stringtype=unspecified
,the produced connection URL is
jdbc:postgresql://localhost:32793/databasename?loggerLevel=OFF?stringtype=unspecified
instead of...&stringtype=unspecified
The text was updated successfully, but these errors were encountered: