feat: allow oracle-free to use RemoteDockerImage constructor#10263
feat: allow oracle-free to use RemoteDockerImage constructor#10263KyleAure wants to merge 1 commit intotestcontainers:mainfrom
Conversation
|
FYI - @eddumelendez |
There was a problem hiding this comment.
Pull Request Overview
This PR enables the Oracle Free container to be instantiated with a Future<String> image (e.g., a remote Docker image), matching the superclass API and centralizing the waiting strategy in a shared method.
- Added a new
OracleContainer(Future<String> image)constructor - Extracted
waitingForsetup into a reusablepreconfigure()method - Updated the existing
DockerImageNameconstructor to callpreconfigure()
Comments suppressed due to low confidence (2)
modules/oracle-free/src/main/java/org/testcontainers/oracle/OracleContainer.java:67
- Please add JavaDoc for this constructor to explain its purpose and expected behavior when supplying a Future image.
public OracleContainer(Future<String> image) {
modules/oracle-free/src/main/java/org/testcontainers/oracle/OracleContainer.java:67
- There are no existing tests for this new constructor; please add unit tests that resolve the Future and verify the waiting strategy is applied correctly.
public OracleContainer(Future<String> image) {
| this(DockerImageName.parse(dockerImageName)); | ||
| } | ||
|
|
||
| public OracleContainer(Future<String> image) { |
There was a problem hiding this comment.
The new Future constructor does not enforce compatibility with DEFAULT_IMAGE_NAME. Consider parsing the resolved image into a DockerImageName and calling assertCompatibleWith(DEFAULT_IMAGE_NAME) to maintain consistent safety checks.
There was a problem hiding this comment.
That comment is actually correct.
| preconfigure(); | ||
| } | ||
|
|
||
| public OracleContainer(final DockerImageName dockerImageName) { | ||
| super(dockerImageName); | ||
| dockerImageName.assertCompatibleWith(DEFAULT_IMAGE_NAME); | ||
| preconfigure(); | ||
| } | ||
|
|
||
| private void preconfigure() { |
There was a problem hiding this comment.
[nitpick] The method name preconfigure is generic; consider renaming it to something more descriptive, like applyDefaultWaitingStrategy or configureStartupWait for clarity.
| preconfigure(); | |
| } | |
| public OracleContainer(final DockerImageName dockerImageName) { | |
| super(dockerImageName); | |
| dockerImageName.assertCompatibleWith(DEFAULT_IMAGE_NAME); | |
| preconfigure(); | |
| } | |
| private void preconfigure() { | |
| configureStartupWait(); | |
| } | |
| public OracleContainer(final DockerImageName dockerImageName) { | |
| super(dockerImageName); | |
| dockerImageName.assertCompatibleWith(DEFAULT_IMAGE_NAME); | |
| configureStartupWait(); | |
| } | |
| private void configureStartupWait() { |
There was a problem hiding this comment.
I think we normally have this config in a protected void configure() method.
|
@eddumelendez |
Allow the Oracle Free container to leverage the use of a RemoteDockerImage by exposing an equivalent constructor as the JdbcDatabaseContainer superclass.