Class JsonValueAssert<VALUE_TYPE>

java.lang.Object
org.assertj.core.api.AbstractAssert<JsonValueAssert<VALUE_TYPE>,VALUE_TYPE>
com.devsoap.json.JsonValueAssert<VALUE_TYPE>
All Implemented Interfaces:
org.assertj.core.api.Assert<JsonValueAssert<VALUE_TYPE>,VALUE_TYPE>, org.assertj.core.api.Descriptable<JsonValueAssert<VALUE_TYPE>>, org.assertj.core.api.ExtensionPoints<JsonValueAssert<VALUE_TYPE>,VALUE_TYPE>

public class JsonValueAssert<VALUE_TYPE> extends org.assertj.core.api.AbstractAssert<JsonValueAssert<VALUE_TYPE>,VALUE_TYPE>
JSON Array Assertions
  • Field Summary

    Fields inherited from class org.assertj.core.api.AbstractAssert

    actual, info, myself, objects, throwUnsupportedExceptionOnEquals
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    JsonValueAssert(String fieldName, jakarta.json.JsonValue value, VALUE_TYPE fieldValue)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    array(String fieldName)
    Get field as array
    <ITEM> org.assertj.core.api.ListAssert<ITEM>
    array(String fieldName, Class<ITEM> itemClass)
    Get field as typed array
    Cast value to Array
    org.assertj.core.api.BigDecimalAssert
    Cast value to BigDecimal
    org.assertj.core.api.BigIntegerAssert
    Cast value to BigInteger
    org.assertj.core.api.DoubleAssert
    Cast value to Double
    org.assertj.core.api.IntegerAssert
    Cast value to Integer
    org.assertj.core.api.AbstractLongAssert<?>
    Cast value to Long
    field(String fieldName)
    Get a field or property by name
    field(String fieldName, Class<VALUE_TYPE> type)
    Get typed field
    isEqualTo(Object expected)
     
    matches(String regex)
    Assert value matches regular expression
    Assert value does not match regular expression
    path(String... fields)
    Get field by path

    Methods inherited from class org.assertj.core.api.AbstractAssert

    areEqual, asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, doesNotHaveToString, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, hasToString, inBinary, inHexadecimal, is, isElementOfCustomAssert, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, newListAssertInstance, overridingErrorMessage, overridingErrorMessage, satisfies, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOfForProxy, satisfiesForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnError

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface org.assertj.core.api.Descriptable

    as, as, as, describedAs, describedAs
  • Constructor Details

    • JsonValueAssert

      protected JsonValueAssert(String fieldName, jakarta.json.JsonValue value, VALUE_TYPE fieldValue)
  • Method Details

    • field

      public JsonValueAssert<?> field(String fieldName)
      Get a field or property by name
      Parameters:
      fieldName - the field name
      Returns:
      the json value assert
    • field

      public JsonValueAssert<VALUE_TYPE> field(String fieldName, Class<VALUE_TYPE> type)
      Get typed field
      Parameters:
      fieldName - the field name
      type - the type
      Returns:
      the json value assert
    • array

      public JsonArrayAssert<?> array(String fieldName)
      Get field as array
      Parameters:
      fieldName - the field name
      Returns:
      the json array assert
    • array

      public <ITEM> org.assertj.core.api.ListAssert<ITEM> array(String fieldName, Class<ITEM> itemClass)
      Get field as typed array
      Type Parameters:
      ITEM - the type parameter
      Parameters:
      fieldName - the field name
      itemClass - the item class
      Returns:
      the list assert
    • path

      public JsonValueAssert<?> path(String... fields)
      Get field by path
      Parameters:
      fields - the fields
      Returns:
      the json value assert
    • asInteger

      public org.assertj.core.api.IntegerAssert asInteger()
      Cast value to Integer
      Returns:
      the integer assert
    • asBigDecimal

      public org.assertj.core.api.BigDecimalAssert asBigDecimal()
      Cast value to BigDecimal
      Returns:
      the big decimal assert
    • asBigInteger

      public org.assertj.core.api.BigIntegerAssert asBigInteger()
      Cast value to BigInteger
      Returns:
      the big integer assert
    • asDouble

      public org.assertj.core.api.DoubleAssert asDouble()
      Cast value to Double
      Returns:
      the double assert
    • asLong

      public org.assertj.core.api.AbstractLongAssert<?> asLong()
      Cast value to Long
      Returns:
      the abstract long assert
    • asArray

      public JsonArrayAssert<?> asArray()
      Cast value to Array
      Returns:
      the json array assert
    • matches

      public JsonValueAssert<?> matches(String regex)
      Assert value matches regular expression
      Parameters:
      regex - the regex
      Returns:
      the json value assert
    • notMatches

      public JsonValueAssert<?> notMatches(String regex)
      Assert value does not match regular expression
      Parameters:
      regex - the regex
      Returns:
      the json value assert
    • isEqualTo

      public JsonValueAssert<VALUE_TYPE> isEqualTo(Object expected)
      Specified by:
      isEqualTo in interface org.assertj.core.api.Assert<JsonValueAssert<VALUE_TYPE>,VALUE_TYPE>
      Overrides:
      isEqualTo in class org.assertj.core.api.AbstractAssert<JsonValueAssert<VALUE_TYPE>,VALUE_TYPE>