Tag Archives: unit-testing

Spring Dependency Injection in Mule FunctionalTestCase

By | December 13, 2015

In this article I will show how to accomplish dependency injection of fields in tests that inherit from the Mule class FunctionalTestCase; both of dependencies to Spring beans and of values from property files. Background On an earlier occasion, I have attempted to use the standard @RunWith(SpringJUnit4ClassRunner.class) annotation in order to be able to have Spring… Read More »

Embedded ActiveMQ Broker with Mule

By | June 26, 2014

In this post I will show how an embedded ActiveMQ broker is automatically started when using the broker URL “vm://localhost” in a Mule JMS connector, without any additional configuration, and how to disable this behaviour. I will also look at how to explicitly configure an embedded ActiveMQ broker in a Mule configuration file. As documented… Read More »

Mule Unit Tests with Inbound Message Properties in Session or Invocation Scope

By | February 28, 2014

My very first blog post described how to unit test Mule transformers that access session and/or invocation scoped message properties. To accomplish that I developed a new, better, Mule message. In this post I will describe how this new Mule message class can be extended to allow for session and/or invocation scoped message properties to… Read More »

Comparing XML with XMLUnit and Character Encoding

By | September 18, 2013

XMLUnit is an excellent library for comparing XML when you want to go beyond mere string comparison and, for instance, disregard whitespace or other aspects of the XML fragments that are compared. In my current area of interest, systems integration, the fact that two XML fragments convey the same information is not always enough. In… Read More »

Unit-testing Mule transformers which access session and/or invocation scopes

By | July 4, 2013

Problem When attempting to unit-test a Mule transformer that need access to session- or invocation-scoped message properties, I found the result to be an IllegalStateException that told me: Detected an attempt to set an invocation or session property, but a MuleEvent hasn’t been created using this message yet. I managed to trace the problem to… Read More »