All Known Subinterfaces:
JacksonValidators

public interface JacksonAssertThat
Creates validators for the Jackson API that throw AssertionError immediately on validation failure.
  • Method Details

    • assertThat

      <T extends JsonNode> JsonNodeValidator<T> assertThat(T value, String name)
      Validates the state of a JsonNode.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and 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 assert keyword, like so: assert that(value, name).

      Type Parameters:
      T - the type of the JsonNode
      Parameters:
      value - the value
      name - the name of the value
      Returns:
      a validator for the value
      Throws:
      NullPointerException - if name is null
      IllegalArgumentException - if name contains whitespace, or is empty
    • assertThat

      <T extends JsonNode> JsonNodeValidator<T> assertThat(T value)
      Validates the state of a JsonNode.

      The returned validator captures exceptions on validation failure rather than throwing them immediately. The exceptions are converted into an AssertionError and 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 assert keyword, like so: assert that(value, name).

      Type Parameters:
      T - the type of the JsonNode
      Parameters:
      value - the value
      Returns:
      a validator for the value