Closed ongiant closed 4 months ago
@ongiant nice solution, thanks a lot for sharing this!
Thanks again for sharing this solution, I have added a link from the repo documentation: https://github.com/ThomasVitale/cloud-native-spring-in-action/blob/main/Guides/testing-rabbitmq-with-testcontainers.md
In chapter 10.4.3, there is a note that presents one exercise for reader. It says:
If you want to test the application against a specific broker (in our case, it would be for RabbitMQ), you can rely on Testcontainers, as you learned in the previous chapter. I’ll leave that up to you as an exercise.
It stuck me for a long time.The solution code provided below that can serve as a reference for others:
real rabbitMQ broker integration test
then you need to add
awaitility
dependency andJackson2JsonMessageConverter
bean for usingParameterizedTypeReference
.Reference: