Framework for making Mule connectors testing easier.
The ConnectorTestCase class simplifies how to call Mule flows and process the corresponding results, you only need to extend it in your connector TestParent class (e.g. SalesforceTestParent).
It includes the following elements:
- getConfigXmlFile(): points to the Mule XML config file (default "automation-test-flows.xml").
- DEFAULT_SPRING_CONFIG_FILE: Default Spring XML file for the testing beans ("AutomationSpringBeans.xml").
- The testData attribute is the TestRunMessage data structure. TestRunMessage can be updated to add runtime generated data thus working as backbone between @Before, @Test and @After methods. Tests interact with the TestRunMessage trough a set of methods.
- runFlowAndGetPayload: provides a simple way for running a flow and getting payload prior to loading its input data in the TestRunMessage:
String payload = runFlowAndGetPayload("test-get-payload");
MyObject payload = runFlowAndGetPayload("test-get-payload");
- runFlowAndGetMessage serves the same purpose as runFlowAndGetPayload but will return a Mule Message
For futher samples please take a look at the included tests.