Interface JacksonAssertThat
- All Known Subinterfaces:
JacksonValidators
AssertionError immediately on validation
failure.-
Method Summary
Modifier and TypeMethodDescription<T extends JsonNode>
JsonNodeValidator<T> assertThat(T value) Validates the state of aJsonNode.<T extends JsonNode>
JsonNodeValidator<T> assertThat(T value, String name) Validates the state of aJsonNode.
-
Method Details
-
assertThat
Validates the state of aJsonNode.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionErrorand can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assertkeyword, like so:assert that(value, name).- Type Parameters:
T- the type of theJsonNode- Parameters:
value- the valuename- the name of the value- Returns:
- a validator for the value
- Throws:
NullPointerException- ifnameis nullIllegalArgumentException- ifnamecontains whitespace, or is empty
-
assertThat
Validates the state of aJsonNode.The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an
AssertionErrorand can be retrieved or thrown once the validation completes. Exceptions unrelated to validation failures are thrown immediately.This method is intended to be used with the
assertkeyword, like so:assert that(value, name).- Type Parameters:
T- the type of theJsonNode- Parameters:
value- the value- Returns:
- a validator for the value
-