---
schema_version: "1"
id: e333c7b3cbecb2a5e38ddd8530955f3f2765015c91926f93f823acd1b2273e1d
title: MUnit Cookbook
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/munit/2.3/munit-cookbook.md
canonical_url: https://docs.mulesoft.com/munit/2.3/munit-cookbook
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 873721083321b42347e464ff303c430dff56f0045b72dd0bf0103af86eec1c9a
description: MuleSoft Documentation Site
release: "2.3"
latest: false
---
---
product: MUnit
version: 2.3
---

# MUnit Cookbook

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

This section links to examples that demonstrate common MUnit usages.

<table><colgroup><col> <col></colgroup><thead><tr><th>Example</th><th>Description</th></tr></thead><tbody><tr><td><div><div><p><a href="https://docs.mulesoft.com/munit/2.3/mock-file-cookbook">Mocking Resources for Your Tests</a></p></div></div></td><td><div><div><p>Mocking test code for your MUnit tests.</p></div></div></td></tr><tr><td><div><div><p><a href="https://docs.mulesoft.com/munit/2.3/mock-before-after-foreach-cookbook">Mocking a Message Before and Inside a Foreach Processor</a></p></div></div></td><td><div><div><p>Mocking a processor that can return different payloads.</p></div></div></td></tr><tr><td><div><div><p><a href="https://docs.mulesoft.com/munit/2.3/test-mock-errors-cookbook">Testing and Mocking Errors</a></p></div></div></td><td><div><div><p>Mocking expected errors in your code.</p></div></div></td></tr><tr><td><div><div><p><a href="https://docs.mulesoft.com/munit/2.3/use-environment-properties-on-tests-cookbook">Testing with Environment Properties</a></p></div></div></td><td><div><div><p>Loading different environment values to your MUnit tests.</p></div></div></td></tr><tr><td><div><div><p><a href="https://docs.mulesoft.com/munit/2.3/utility-classes-cookbook">Using Utility Classes From a Test</a></p></div></div></td><td><div><div><p>Using custom Java classes in your MUnit tests.</p></div></div></td></tr><tr><td><div><div><p><a href="https://docs.mulesoft.com/munit/2.3/ftp-server-cookbook">Configuring FTP Server Utility in an MUnit Test</a></p></div></div></td><td><div><div><p>Configuring an FTP utility to test your FTP server connections.</p></div></div></td></tr><tr><td><div><div><p><a href="https://docs.mulesoft.com/munit/2.3/db-server-cookbook">Configuring DB Server Utility in an MUnit Test</a></p></div></div></td><td><div><div><p>Configuring a database utility to test your database connections.</p></div></div></td></tr><tr><td><div><div><p><a href="https://docs.mulesoft.com/munit/2.3/runtime-patching">Patching the Embedded Mule Runtime Engine Version</a></p></div></div></td><td><div><div><p>Configuring MUnit to run against a patched Mule runtime engine version.</p></div></div></td></tr><tr><td><div><div><p><a href="https://docs.mulesoft.com/munit/2.3/domain-based-application-cookbook">Test Domain-Based Applications</a></p></div></div></td><td><div><div><p>Testing Mule applications that inherit a Mule domain.</p></div></div></td></tr><tr><td><div><div><p><a href="https://docs.mulesoft.com/munit/2.3/test-flow-with-scheduler-cookbook">Testing a Flow with a Scheduler Source</a></p></div></div></td><td><div><div><p>Testing a flow that is triggered by a scheduler.</p></div></div></td></tr><tr><td><div><div><p><a href="https://docs.mulesoft.com/munit/2.3/test-recorder-examples">Recording a Test from an Exchange Example</a></p></div></div></td><td><div><div><p>Using the MUnit test recorder.</p></div></div></td></tr><tr><td><div><div><p><a href="https://docs.mulesoft.com/munit/2.3/test-processor-that-uses-target-variable">Testing a Processor That Stores Data in a Target Variable</a></p></div></div></td><td><div><div><p>Ensuring that the assertions check the content of the stored variable.</p></div></div></td></tr></tbody></table>
