I am using a RabbitMQ in my project.
I have in my consumer the code of the client part of rabbitMQ and the connection need a tls1.1 to connect with the real MQ.
As I understand it, there are two things trying to be tested in the question:
For the first one, as TLS itself is being tested, only connecting to a real instance of RabbitMQ with correct truststore configured will prove that configuration is working
For the second one however, for tests demonstrating features of the app (with tools like Cucumber for readability), you may try a library i'm working on: rabbitmq-mock (and that's why I'm digging up an old post)
Just include it as dependency:
com.github.fridujo
rabbitmq-mock
1.0.14
test
And replace new ConnectionFactory() by new MockConnectionFactory() in your unit test.
Samples are available in the project: https://github.com/fridujo/rabbitmq-mock/blob/master/src/test/java/com/github/fridujo/rabbitmq/mock/IntegrationTest.java