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

# MUnit Cookbook

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

![logo acb active](/mulesoft/current/en-us/_/img/icons/anypoint-code-builder.svg "Anypoint Code Builder")Anypoint Code
Builder

![logo studio active](/mulesoft/current/en-us/_/img/icons/studio.svg "Anypoint Studio")Anypoint Studio

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/3.6/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/3.6/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/3.6/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/3.6/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/3.6/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/3.6/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/3.6/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/3.6/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/3.6/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/3.6/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/3.6/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/3.6/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>
