Search code examples
spring-bootmockingibm-mq

Spring Boot Testing and Websphere MQ


Spring supplies a testing framework to simulate at least in some part the actual calling of implemented web services, one such approach is using MockMvc. Similarly, if I needed to simulate a Postgres database, I can do an in memory H2 database, ignoring various idiosyncracies that sometimes come up.

If my resource is not a database, but a Websphere MQ endpoint, would an ApacheMQ be a good test? At the moment, I'm not striving for performance, but want to know the overall framework is good. If all I did was switch from a Spring test profile to a the non-test, the main code would work.


Solution

  • You can stand up a developer edition MQ queue manager. There are several options, but a container would be the easiest to set-up. See https://developer.ibm.com/series/mq-ready-set-connect/ for how, and other options.