---
schema_version: "1"
id: 7d192b6a0357a0413764b4d261b1520fba510a01f83b9b5352ea6c4a35b27299
title: Core Matchers Reference
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/munit/3.6/core-matchers-reference.md
canonical_url: https://docs.mulesoft.com/munit/3.6/core-matchers-reference
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 0969570af9dbf78c184a33a4cf5660adb1a1e7d0e85f433094a092bfdff39fa1
description: MuleSoft Documentation Site
release: "3.6"
latest: false
---
---
product: MUnit
version: 3.6
---

# Core Matchers Reference

> 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

## nullValue()

Checks that the expression is null.

Example

```xml
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::nullValue()]"/>
```

## notNullValue()

Checks that the expression is not null.

Example

```xml
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::notNullValue()]"/>
```

## withMediaType(String)

Checks that the expression’s media type is the one specified.

Example

```xml
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::withMediaType('text/xml')]"/>
```

## withEncoding(String)

Checks that the expression encoding is the one specified.

Example

```xml
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::withEncoding('UTF-8')]"/>
```

## both(Matcher, Matcher)

Checks that both provided matchers are successful.

Example

```xml
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::both(MunitTools::notNullValue(),MunitTools::equalTo('example'))]"/>
```

## either(Matcher,Matcher)

Checks that at least one of the matchers is successful.

Example

```xml
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::either(MunitTools::nullValue(),MunitTools::equalTo(0))]"/>
```

## not(Object)

Checks if the provided matcher is not successful.

Example

```xml
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::not(0)]"/>
```

Example

```xml
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::not(MunitTools::equalTo(0))]"/>
```

## anyOf(Array<Matcher>)

Checks if any of the matchers are successful.

Example

```xml
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::anyOf([MunitTools::notNullValue(),MunitTools::withMediaType('text/xml'),MunitTools::isEmptyString()])]"/>
```

## allOf(Array<Matcher>)

Checks if all of the matchers are successful.

Example

```xml
<munit-tools:assert-that
expression="#[payload]"
is="#[MunitTools::allOf([MunitTools::notNullValue(),MunitTools::withMediaType('text/xml'),MunitTools::isEmptyString()])]"/>
```

## See Also

- [MUnit Matchers](https://docs.mulesoft.com/munit/3.6/munit-matchers)

- [String Matchers Reference](https://docs.mulesoft.com/munit/3.6/string-matchers-reference)

- [Comparable Matchers Reference](https://docs.mulesoft.com/munit/3.6/comparable-matchers-reference)

- [Iterable and Map Matchers Reference](https://docs.mulesoft.com/munit/3.6/iterable-map-matchers-reference)
