Anypoint Studio
Test Recorder in Studio
The test recorder enables you to record a processing flow and then configure a unit test based on the captured event.
The test recorder captures real data as it goes through your application in Anypoint Studio. By capturing the flow execution, MUnit can automatically generate an MUnit test so that you can configure the necessary mocks and assertions for your test. See Recording a Test from an Exchange Example for a fully working example.
Compatibility
The following table describes the product versions required to use the test recorder.
Product | Version |
---|---|
7.5.0 and later |
|
MUnit |
2.2.5 |
MUnit Anypoint Studio Plugin |
2.5.0 |
Mule runtime engine |
4.3.0 |
Limitations
The test recorder is limited in the following ways when you create MUnit tests:
-
You cannot create tests for flows with Mule errors raised inside the flow or already existing in the incoming event, not even if they are handled by an on error continue error handler.
-
A recorded flow execution ends successfully, but the result does not reach its destination because the application is killed.
-
Your validations fail every time your test runs if you configure Spy or Assert processors to assert values for random data, time-dependent information (such as timestamps), or values resulting from parallel processes, because those values change in every execution.
-
Mocking values resulting from parallel processes causes a mixture of real and mocked data that compromises the execution of the processors that follow in your test.
-
Although the recorder supports data iteration in the flow, such as recursions or loops, it does not support cases in which the structure of the data being tested changes inside the iteration.
-
The recorder does not support mocking a message before or inside a Foreach processor.