RabbitMQ

For local development it is usually a practise to spawn test containers on a local machine and run them all the time during development.
Also embedded broker/server is also an option, but RabbitMQ and Postgres don’t offer embedded solutions out of the box and setting a custom one would take too much time.
So what you can easily do is spawn local short lived docker containers with these technologies. 
A good and tested solution to this problem is using the Testcontainers test dependency. Test containers
So, with provided RabbitMQ and Postgres images, you just launch containers on Test Suite start and they get automatically destroyed on shutdown.

Integration testing with RabbitMQ and Postgres in Spring Boot when using CI (and not only)

The application to test uses Postgres and RabbitMQ. It also uses “spring-boot-starter-amqp” and its “RabbitTemplate”. The app runs migrations with Flyway and uses Postgres syntax. Because of inconvenience and since there is CI (Continuous Integration) in a remote server, running RabbitMQ and Postgres instances can’t be provided. How can we set up our test environment to provide those RabbitMQ and Postgres DB instances, so it is clean on each test suite run?
Subscribe to RabbitMQ