---
schema_version: "1"
id: 9cb91b74e30148143a06043f36d066c86364f14ba4cf4bd831664e448de67443
title: MUnit Test Recorder in Anypoint Studio
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/munit/latest/test-recorder.md
canonical_url: https://docs.mulesoft.com/munit/latest/test-recorder
source_site: docs.mulesoft.com
content_type: documentation
content_hash: b0e96258f360cd2818d4113505754612320df87093c81c4ed2693f42e9cd8aaf
description: MuleSoft Documentation Site
release: "3.7"
latest: true
---
---
product: MUnit
version: 3.7
is-latest-version: true
---

# MUnit Test Recorder in Anypoint Studio

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

The MUnit Test Recorder captures real flow execution data in Anypoint Studio and automatically
generates an MUnit test with configured mocks and assertions. Use it to quickly create tests based
on actual application behavior without writing test code from scratch. See
[Record an MUnit Test from an Anypoint Exchange Example](https://docs.mulesoft.com/munit/latest/test-recorder-examples) for a fully working
example.

## Compatibility

The following table describes the product versions required to use the Test Recorder.

<table><colgroup><col> <col></colgroup><thead><tr><th>Product</th><th>Version</th></tr></thead><tbody><tr><td><div><div><p>Anypoint Studio</p></div></div></td><td><div><div><p>7.5.0 and later</p></div></div></td></tr><tr><td><div><div><p>MUnit</p></div></div></td><td><div><div><p>2.2.5 and later</p></div></div></td></tr><tr><td><div><div><p>MUnit Anypoint Studio Plugin</p></div></div></td><td><div><div><p>2.5.0 and later</p></div></div></td></tr><tr><td><div><div><p>Mule runtime engine</p></div></div></td><td><div><div><p>4.3.0 and later</p></div></div></td></tr></tbody></table>

## Limitations

The test recorder has the following limitations 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, even if an **on error continue** error handler controls them.

- 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.

- When using the Test Recorder to generate a test over your flow, you can only mock parameters
  included in your flow. You cannot mock parameters in sub-flows or in referenced flows through the
  Test Recorder UI. If you need to mock parameters in sub-flows of any other process in the project,
  you can modify the mocking component after creating the test.

## See Also

- [Record an MUnit Test from an Anypoint Exchange Example](https://docs.mulesoft.com/munit/latest/test-recorder-examples)

- [Mock Messages Before and Inside a Foreach Processor in MUnit](https://docs.mulesoft.com/munit/latest/mock-before-after-foreach-cookbook)
