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

# Core Matchers Reference

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

## 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/2.3/munit-matchers)

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

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

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