Skip to content

Update @DynamicPropertySource examples regarding changes in Testcontainers #29939

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

Closed
sbrannen opened this issue Feb 7, 2023 · 3 comments
Closed
Assignees
Labels
in: test Issues in the test module status: backported An issue that has been backported to maintenance branches type: documentation A documentation task
Milestone

Comments

@sbrannen
Copy link
Member

sbrannen commented Feb 7, 2023

While reviewing #29937, I realized that our Testcontainers examples are outdated: there is no longer a RedisContainer. Instead, a Redis container is configured via a GenericContainer, as documented in the official Testcontainers documentation.

@sbrannen sbrannen added in: test Issues in the test module type: documentation A documentation task labels Feb 7, 2023
@sbrannen sbrannen added this to the 6.0.5 milestone Feb 7, 2023
@sbrannen sbrannen self-assigned this Feb 7, 2023
@github-actions github-actions bot added status: backported An issue that has been backported to maintenance branches and removed for: backport-to-5.3.x labels Feb 7, 2023
@sbrannen
Copy link
Member Author

sbrannen commented Feb 7, 2023

@eddumelendez, I'd appreciate it if you could quickly review my changes in 8e9dc35 and confirm that our examples are up to date with the current APIs and recommendations for Testcontainers.

Thanks

@eddumelendez
Copy link
Contributor

Hi @sbrannen ! I think for the example GenericContainer("redis:5.0.3-alpine") would be much better. DockerImageName is mostly used for Image name substitution when it is used along with Testcontainers modules such as MySQLContainer, PostgreSQLContainer and so on. getFirstMappedPort makes sense in this example 👍🏽

Thanks for updating docs related to Testcontainers :)

@sbrannen
Copy link
Member Author

sbrannen commented Feb 7, 2023

I think for the example GenericContainer("redis:5.0.3-alpine") would be much better. DockerImageName is mostly used for Image name substitution when it is used along with Testcontainers modules such as MySQLContainer, PostgreSQLContainer and so on.

Good to know. Thanks for the explanation.

FWIW, I based our examples on the examples provided at https://www.testcontainers.org/quickstart/junit_5_quickstart/.

getFirstMappedPort makes sense in this example 👍🏽

👍

Thanks for updating docs related to Testcontainers :)

Sure thing.

Reopening to address above suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: test Issues in the test module status: backported An issue that has been backported to maintenance branches type: documentation A documentation task
Projects
None yet
Development

No branches or pull requests

2 participants