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.

Comment From: sbrannen

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

Thanks

Comment From: eddumelendez

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 :)

Comment From: 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.

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.