-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
MySQLContainer does not have getter for the databaseName field #473
Comments
Hi @dmatej, At least in TestContainers 1.4.3, there is DB name ATM is static and has |
The problem is not about setting the test container but with using it's active configuration for the creation of the JDBC resource, this is why URL is not useful. I would like to simply use getters to configure the JDBC pool from the test container's getters but now I have to duplicate values or use sometimes getters sometimes static values. The code is inconsistent and programming not intuitive, I had to find out where can I get values I needed. getFirstMappedPort has another implementation than getUrl uses - this is the reason why I wrote the getUrl method parsing port from the url instead (but now I see both ways give same result, ok). It would be much more transparent to have standard JDBC getters and let user to access all useful values. Or maybe to create some transfer object for that and provide getJdbcConfiguration?.
|
@bsideup I suppose there is no damage in adding a getter for |
…SQLContainer to address #473
…SQLContainer to address #473
Container classes which want to support this feature need to override getDatabaseName() method. Fixes #473
In Java EE containers like Payara is JDBC pool and JDBC driver configured via properties, not URL. It is more useful to provide username, password, serverName, portName and databaseName etc. than URL.
getJdbcUrl is higher abstraction layer over it.
The text was updated successfully, but these errors were encountered: