Changes introduced in https://github.com/spring-projects/spring-boot/commit/8427e813af08b9c8cf18e1ad84c8ee2ccebea9e9 are quite nice. Thanks! It kind of help me get something running (I think I'm using it wrong).

First, currently there is no official RedisContainer, DaprPlacementContainer, DaprSidecarContainer. So, If the code below is just plain GenericContainer for the three of them, it will fail because there is already an existing bean.

https://github.com/eddumelendez/dapr-testcontainers/blob/22034a7163af28722159860f112f475a48a11ed1/write-app/src/test/java/com/salaboy/dapr/javaapp/TestApp.java#L26-L38

I think it will be very common to use plain GenericContainer if no Container class is available.

Also, as you can see I'm using @DynamicPropertySource 👍🏽. However, there is one difference which can confuse users, I think. When using similar approach in tests, containers start first and then properties can be mapped, even env vars or system properties. In the repository I shared, it is needed to set a system property but start the container manually was required. Otherwise, container should start first before to get the mapped port would be throw and fail the initialization.

https://github.com/eddumelendez/dapr-testcontainers/blob/devtime/write-app/src/test/java/com/salaboy/dapr/javaapp/TestApp.java#L40-L44

I think this should be documented or provide similar experience to do not confuse users.

Example project: https://github.com/eddumelendez/dapr-testcontainers/tree/devtime

Thanks once again!

Comment From: philwebb

Thanks @eddumelendez!

The bean name issue was me misunderstanding how the BeanNameGenerator worked. I think using the class/field name makes more sense.

For the @DynamicPropertySource issue, I think we can safely start the container when the field value is read. We can't to this with the @Bean methods because we can't instantiate them early, but we can for @ImportTestcontainers

I've made both of those changes in 56af1569d3edde34d12ff9ba49b5810bca544f1e (logged against the original issue since we're still at SNAPSHOT).

Comment From: eddumelendez

Thanks @philwebb ! just test it and works 👌🏽