Uploaded image for project: 'Spring AMQP'
  1. Spring AMQP
  2. AMQP-670

Consider some environment for the @RabbitListenerTest to test listeners without Broker

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Complete
    • None
    • 2.0 M3
    • Test Support

    Description

      Some ideas can be borrowed from the Spring Cloud Contract, where they can do:

      In order to avoid that Spring AMQP is trying to connect to a running broker during our tests we configure a mock ConnectionFactory.

      To disable the mocked ConnectionFactory set the property stubrunner.amqp.mockConnection=false

      Another idea is really to provide a feature like EmbeddedBroker, where we can intercept all the declaration requests and store them in the memory cache. When the send request comes from the spied (or mocked) RabbitTemplate, we can do the same routing logic like the real Broker.

      We can even try to hide all the hard send/receive logic in the specific EmbeddedBrokerConnectionFactory implementation to avoid mocking RabbitTemplate and RabbitAdmin.

      Any other ideas are welcome!

      Attachments

        Activity

          People

            grussell Gary Russell
            abilan Artem Bilan
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: