How to use hermes jms in soapui for IBM MQ
I discussed on my previous post about how to configure HermesJMS in SOAP UI for IBM MQ.
Today, I am going to discuss about how we will use JMS Session which we created during configuration of hermes jms for sending/receiving messages to/from Queue from SOAP UI.
Prerequisite
- Destinations/Queues must be created on IBM MQ and Channels are must be started if any.
- SOAP UI must be configure with Hermes JMS.
- JMS session and Destinations/Queues must be defined.
In previous post, we created JMS Session and destinations as below.
Use of Hermes JMS in SOAP UI
HermesJMS is an extensible console that helps Tester to create test cases making it easy to browse or search queues and topics, copy messages around and delete them.
Step 1: Create New SOAP Project using any dummy WSDL. You can use WSDL from SoapUI tutorials.
Once, you will click OK button new SOAP Project will look like below.
Step 2: Create New Test Suite by right click on SOAP UI Project created in Step1.
Step 3: Create New Test Case by right click on Test Suite created in Step2.
For example, I will create create three Test Request steps in SOAP UI test case. One Test Request step for Receive Destination Queue to consume message and one Test Request to send request to destination queue and One Test Request step for send and receive messages.
Note: Make sure “Add SOAP Response Assertion” check box to be unchecked, otherwise test suite always fails.
Step 6: Map JMS Endpoints for Receive and send destinations.
- send only jms://LocalMQ::queue_Q1
- receive only jms://LocalMQ::-::queue_Q2
- send and receive jms://LocalMQ::queue_Q1::queue_Q2
For Dynamic mock response, you can write Groovy script and also can set JMS header attribute like ReplyTo, Expiration time, time-out etc.
Related Topic: