PostgreSQLContainer : use getters for user, pass, dbname - #2048
Conversation
|
Hi @kostapc, Could you please clarify this change? |
|
Case was at env, when it necessary to override default container config. So without getters it was'n possible to just override getters methods and get correct jdbcUrl for example. |
|
@kostapc why would you override them if there are |
This is second case. In some CI/CD env build runs in docker and docker-in-docker is not allowed. And because docker version and so on checked on object creation, the only solution is provide mocked container object to tests code. For example mocked container may points to independent test service inside that ci. |
This does not sound like "the only solution" to me. You may want to create your own abstraction/wrapper and encapsulate the Docker usage. Mocking Testcontainers' classes does not sound like a good idea to be honest.
FYI once #2024 is merged, we won't be doing side effects (image pulling) in constructors anymore
It... depends? |
I'm totally agree with that point and do not trying to force that way of usage testcontainers. Using getters instead of field access by itself do not connected with testcontainer usage way and must not change any behavior.
This is exactly that think that i trying to do. But instantiating testcontainer java object forces checking docker env and fails if nothing found. And it's not possible to have java objects with configuration, but avoid docker machinery. Here the root of my problem and looks like referred pull request can solve it. |
|
@kostapc very soon - we wanted to do a release this weekend but as you can see have had an unexpected broken build for one environment. We're working on it. |
No description provided.