Package org.springframework.test.web.reactive.server

# Class JsonPathAssertions

java.lang.Object
org.springframework.test.web.reactive.server.JsonPathAssertions

public class JsonPathAssertions extends Object
JsonPath assertions.

Since:
  5.0
Author:
  Rossen Stoyanchev, Stephane Nicoll
See Also:
  - https://github.com/jayway/JsonPath
  - `JsonPathExpectationsHelper`

## Method Summary

Modifier and Type
Method
Description
`WebTestClient.BodyContentSpec`
`doesNotExist()`
Applies `JsonPathExpectationsHelper.doesNotExist(String)`.
`WebTestClient.BodyContentSpec`
`doesNotHaveJsonPath()`
Applies `JsonPathExpectationsHelper.doesNotHaveJsonPath(java.lang.String)`.
`boolean`
`equals(Object obj)`
`WebTestClient.BodyContentSpec`
`exists()`
Applies `JsonPathExpectationsHelper.exists(String)`.
`int`
`hashCode()`
`WebTestClient.BodyContentSpec`
`hasJsonPath()`
Applies `JsonPathExpectationsHelper.hasJsonPath(java.lang.String)`.
`WebTestClient.BodyContentSpec`
`isArray()`
Applies `JsonPathExpectationsHelper.assertValueIsArray(String)`.
`WebTestClient.BodyContentSpec`
`isBoolean()`
Applies `JsonPathExpectationsHelper.assertValueIsBoolean(String)`.
`WebTestClient.BodyContentSpec`
`isEmpty()`
Applies `JsonPathExpectationsHelper.assertValueIsEmpty(String)`.
`WebTestClient.BodyContentSpec`
`isEqualTo(Object expectedValue)`
Applies `JsonPathExpectationsHelper.assertValue(String, Object)`.
`WebTestClient.BodyContentSpec`
`isMap()`
Applies `JsonPathExpectationsHelper.assertValueIsMap(String)`.
`WebTestClient.BodyContentSpec`
`isNotEmpty()`
Applies `JsonPathExpectationsHelper.assertValueIsNotEmpty(String)`.
`WebTestClient.BodyContentSpec`
`isNumber()`
Applies `JsonPathExpectationsHelper.assertValueIsNumber(String)`.
`<T> WebTestClient.BodyContentSpec`
`value(Class<T> targetType, Consumer<T> consumer)`
Consume the result of the JSONPath evaluation and provide a target class.
`<T> WebTestClient.BodyContentSpec`
`value(Class<T> targetType, Matcher<? super T> matcher)`
Delegates to `JsonPathExpectationsHelper.assertValue(String, Matcher, Class)`.
`<T> WebTestClient.BodyContentSpec`
`value(Consumer<T> consumer)`
Consume the result of the JSONPath evaluation.
`<T> WebTestClient.BodyContentSpec`
`value(Consumer<T> consumer, Class<T> targetType)`
Deprecated, for removal: This API element is subject to removal in a future version.
in favor of `value(Class, Consumer)`
`<T> WebTestClient.BodyContentSpec`
`value(Matcher<? super T> matcher)`
Delegates to `JsonPathExpectationsHelper.assertValue(String, Matcher)`.
`<T> WebTestClient.BodyContentSpec`
`value(Matcher<? super T> matcher, Class<T> targetType)`
Deprecated, for removal: This API element is subject to removal in a future version.
in favor of `value(Class, Matcher)`
`<T> WebTestClient.BodyContentSpec`
`value(org.springframework.core.ParameterizedTypeReference<T> targetType, Consumer<T> consumer)`
Consume the result of the JSONPath evaluation and provide a parameterized type.
`<T> WebTestClient.BodyContentSpec`
`value(org.springframework.core.ParameterizedTypeReference<T> targetType, Matcher<? super T> matcher)`
Delegates to `JsonPathExpectationsHelper.assertValue(String, Matcher, ParameterizedTypeReference)`.

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

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

## Method Details

### isEqualTo

public WebTestClient.BodyContentSpec isEqualTo(Object expectedValue)
Applies `JsonPathExpectationsHelper.assertValue(String, Object)`.

### exists

public WebTestClient.BodyContentSpec exists()
Applies `JsonPathExpectationsHelper.exists(String)`.

### doesNotExist

public WebTestClient.BodyContentSpec doesNotExist()
Applies `JsonPathExpectationsHelper.doesNotExist(String)`.

### isEmpty

public WebTestClient.BodyContentSpec isEmpty()
Applies `JsonPathExpectationsHelper.assertValueIsEmpty(String)`.

### isNotEmpty

public WebTestClient.BodyContentSpec isNotEmpty()
Applies `JsonPathExpectationsHelper.assertValueIsNotEmpty(String)`.

### hasJsonPath

public WebTestClient.BodyContentSpec hasJsonPath()
Applies `JsonPathExpectationsHelper.hasJsonPath(java.lang.String)`.

Since:
  5.0.3

### doesNotHaveJsonPath

public WebTestClient.BodyContentSpec doesNotHaveJsonPath()
Applies `JsonPathExpectationsHelper.doesNotHaveJsonPath(java.lang.String)`.

Since:
  5.0.3

### isBoolean

public WebTestClient.BodyContentSpec isBoolean()
Applies `JsonPathExpectationsHelper.assertValueIsBoolean(String)`.

### isNumber

public WebTestClient.BodyContentSpec isNumber()
Applies `JsonPathExpectationsHelper.assertValueIsNumber(String)`.

### isArray

public WebTestClient.BodyContentSpec isArray()
Applies `JsonPathExpectationsHelper.assertValueIsArray(String)`.

### isMap

public WebTestClient.BodyContentSpec isMap()
Applies `JsonPathExpectationsHelper.assertValueIsMap(String)`.

### value

public <T> WebTestClient.BodyContentSpec value(Matcher<? super T> matcher)
Delegates to `JsonPathExpectationsHelper.assertValue(String, Matcher)`.

Since:
  5.1

### value

public <T> WebTestClient.BodyContentSpec value(Class<T> targetType, Matcher<? super T> matcher)
Delegates to `JsonPathExpectationsHelper.assertValue(String, Matcher, Class)`.

Since:
  6.2

### value

@Deprecated(since="6.2", forRemoval=true) public <T> WebTestClient.BodyContentSpec value(Matcher<? super T> matcher, Class<T> targetType)
Deprecated, for removal: This API element is subject to removal in a future version.
in favor of `value(Class, Matcher)`
Delegates to `JsonPathExpectationsHelper.assertValue(String, Matcher, Class)`.

Since:
  5.1

### value

public <T> WebTestClient.BodyContentSpec value(org.springframework.core.ParameterizedTypeReference<T> targetType, Matcher<? super T> matcher)
Delegates to `JsonPathExpectationsHelper.assertValue(String, Matcher, ParameterizedTypeReference)`.

Since:
  6.2

### value

public <T> WebTestClient.BodyContentSpec value(Consumer<T> consumer)
Consume the result of the JSONPath evaluation.

Since:
  5.1

### value

public <T> WebTestClient.BodyContentSpec value(Class<T> targetType, Consumer<T> consumer)
Consume the result of the JSONPath evaluation and provide a target class.

Since:
  6.2

### value

@Deprecated(since="6.2", forRemoval=true) public <T> WebTestClient.BodyContentSpec value(Consumer<T> consumer, Class<T> targetType)
Deprecated, for removal: This API element is subject to removal in a future version.
in favor of `value(Class, Consumer)`
Consume the result of the JSONPath evaluation and provide a target class.

Since:
  5.1

### value

public <T> WebTestClient.BodyContentSpec value(org.springframework.core.ParameterizedTypeReference<T> targetType, Consumer<T> consumer)
Consume the result of the JSONPath evaluation and provide a parameterized type.

Since:
  6.2

### equals

public boolean equals(@Nullable Object obj)

Overrides:
  `equals` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`