Contact Us 1-800-596-4880

Patch the Embedded Mule Runtime Engine Version in MUnit

logo acb active Anypoint Code Builder

logo studio active Anypoint Studio

Patch the embedded Mule runtime engine version that MUnit uses to run tests, overriding the default version defined in your mule-artifact.json file. You can configure the patched version from Maven or Anypoint Studio.

Patch MUnit Using Maven

By default, MUnit runs against the Mule version corresponding to the minMuleVersion defined in the mule-artifact.json file. You can override this version by setting the munit.runtimeVersion parameter in the munit-maven-plugin artifact configuration:

<plugin>
    <groupId>com.mulesoft.munit.tools</groupId>
    <artifactId>munit-maven-plugin</artifactId>
    <version>${munit.version}</version>
    <executions>
        <execution>
            <id>test</id>
            <phase>test</phase>
            <goals>
                <goal>test</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
      <munit.runtimeVersion>4.3.0-20200727</munit.runtimeVersion> (1)
    </configuration>
</plugin>
1 Be sure to replace the placeholder version in this example with your version, as provided by MuleSoft.

To set the version from the command line, use -Dmunit.runtimeVersion= (MUnit 3.7.2 and later).

The -DruntimeVersion property is deprecated.

Patch MUnit Using Studio

By default, MUnit runs in Anypoint Studio with the Mule runtime engine version of the project server. You can override this version by specifying the patched Mule version in the MUnit run configuration menu:

  1. In the menu bar, select Run and Run Configurations.

  2. Under MUnit, select your MUnit test file.

  3. In the Mule Runtime Version field under Advanced Settings, type the Mule patched version to use.

    Patched Mule runtime version used for the test.

If you already set the munit.runtimeVersion parameter in the POM file of your project, click Load configuration from POM file to automatically load this version into the Mule Runtime Version field.