Package org.springframework.test.util

# Class JsonExpectationsHelper

java.lang.Object
org.springframework.test.util.JsonExpectationsHelper

@Deprecated(since="6.2") public class JsonExpectationsHelper extends Object
Deprecated.
in favor of using `JSONAssert` directly or the `JsonComparator` abstraction
A helper class for assertions on JSON content.

Use of this class requires the JSONassert library.

Since:
  4.1
Author:
  Sebastien Deleuze

## Constructor Summary

Constructors
Constructor
Description
`JsonExpectationsHelper()`
Deprecated.

## Method Summary

Modifier and Type
Method
Description
`void`
`assertJsonEqual(String expected, String actual)`
Deprecated.
Parse the expected and actual strings as JSON and assert the two are "similar" - i.e.
`void`
`assertJsonEqual(String expected, String actual, boolean strict)`
Deprecated.
Parse the expected and actual strings as JSON and assert the two are "similar" - i.e.
`void`
`assertJsonNotEqual(String expected, String actual)`
Deprecated.
Parse the expected and actual strings as JSON and assert the two are "not similar" - i.e.
`void`
`assertJsonNotEqual(String expected, String actual, boolean strict)`
Deprecated.
Parse the expected and actual strings as JSON and assert the two are "not similar" - i.e.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### JsonExpectationsHelper

public JsonExpectationsHelper()
Deprecated.

## Method Details

### assertJsonEqual

public void assertJsonEqual(String expected, String actual) throws Exception
Deprecated.
Parse the expected and actual strings as JSON and assert the two are "similar" - i.e. they contain the same attribute-value pairs regardless of formatting with lenient checking (extensible content and non-strict array ordering).

Parameters:
  `expected` - the expected JSON content
  `actual` - the actual JSON content
Throws:
  `Exception`
Since:
  4.1
See Also:
  - `assertJsonEqual(String, String, boolean)`

### assertJsonEqual

public void assertJsonEqual(String expected, String actual, boolean strict) throws Exception
Deprecated.
Parse the expected and actual strings as JSON and assert the two are "similar" - i.e. they contain the same attribute-value pairs regardless of formatting.

Can compare in two modes, depending on the `strict` parameter value:

- `true`: strict checking. Not extensible and strict array ordering.
- `false`: lenient checking. Extensible and non-strict array ordering.

Parameters:
  `expected` - the expected JSON content
  `actual` - the actual JSON content
  `strict` - enables strict checking if `true`
Throws:
  `Exception`
Since:
  4.2

### assertJsonNotEqual

public void assertJsonNotEqual(String expected, String actual) throws Exception
Deprecated.
Parse the expected and actual strings as JSON and assert the two are "not similar" - i.e. they contain different attribute-value pairs regardless of formatting with a lenient checking (extensible, and non-strict array ordering).

Parameters:
  `expected` - the expected JSON content
  `actual` - the actual JSON content
Throws:
  `Exception`
Since:
  4.1
See Also:
  - `assertJsonNotEqual(String, String, boolean)`

### assertJsonNotEqual

public void assertJsonNotEqual(String expected, String actual, boolean strict) throws Exception
Deprecated.
Parse the expected and actual strings as JSON and assert the two are "not similar" - i.e. they contain different attribute-value pairs regardless of formatting.

Can compare in two modes, depending on `strict` parameter value:

- `true`: strict checking. Not extensible, and strict array ordering.
- `false`: lenient checking. Extensible, and non-strict array ordering.

Parameters:
  `expected` - the expected JSON content
  `actual` - the actual JSON content
  `strict` - enables strict checking
Throws:
  `Exception`
Since:
  4.2