简体   繁体   中英

How to run integration tests in UAT where the output is a jms message to a queue consumed by another service?

Does anyone know how to verify an output in an end-to-end test where this is a message to a queue?

I'm running an application that relies on 3 different services. I would like to run an end-to-end test that uses REST as entry points and jms queues as outputs. The environment where this runs is UAT and I don't have control over the broker configuration. These output messages are sent to another service outside of the scope of this test so I won't be able to mock the consumer as this needs to be the real one. The test would be run from a separate project pulled from a CI job.

With this situation, is there any way I can verify that, given an input, I get an output in the form of a jms message without interfering with the normal behavior of the environment? I was told I could use the Wiretap pattern but I'm not using any integration framework, just plain Spring JmsTemplate so I would have to kind of duplicate the message myself. Besides, for this, as far as I understand, the message would need to be sent to another queue I can listen to so it would need to be created for this tests.

Any idea?

Thanks.

Create an in-memory ActiveMQ instance specifically for UAT and submit messages there and then do your validation. I've done it before, it's somewhat a pain, but it does give you complete control over your UAT environment without being subject to the whims of your infrastructure/admins/whatever.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM