Class JsonAssert

  • All Implemented Interfaces:
    org.assertj.core.api.Assert<JsonAssert,​String>, org.assertj.core.api.Descriptable<JsonAssert>, org.assertj.core.api.ExtensionPoints<JsonAssert,​String>

    public class JsonAssert
    extends org.assertj.core.api.AbstractAssert<JsonAssert,​String>
    Assertions for JSON based on JsonPath.
    Author:
    poirigui
    • Field Summary

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

        actual, info, myself, throwUnsupportedExceptionOnEquals
    • Constructor Summary

      Constructors 
      Constructor Description
      JsonAssert​(String json)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      JsonAssert doesNotHavePath​(String jsonPath)
      Ensure that a given path does not exist.
      JsonAssert hasPath​(String jsonPath)
      Ensure that a given path exists.
      <T> JsonAssert hasPathWithValue​(String jsonPath, Object value)
      Ensure that a JSON path has the given value.
      static org.assertj.core.api.InstanceOfAssertFactory<String,​JsonAssert> json()  
      • Methods inherited from class org.assertj.core.api.AbstractAssert

        actual, areEqual, asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, doesNotHaveToString, doesNotMatch, doesNotMatch, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, hasToString, inBinary, inHexadecimal, is, isElementOfCustomAssert, isEqualTo, 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, usingEquals, usingEquals, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnError
      • Methods inherited from interface org.assertj.core.api.Descriptable

        as, as, as, describedAs, describedAs
    • Constructor Detail

      • JsonAssert

        public JsonAssert​(String json)
    • Method Detail

      • json

        public static org.assertj.core.api.InstanceOfAssertFactory<String,​JsonAssert> json()
      • hasPath

        public JsonAssert hasPath​(String jsonPath)
        Ensure that a given path exists.
      • doesNotHavePath

        public JsonAssert doesNotHavePath​(String jsonPath)
        Ensure that a given path does not exist.
      • hasPathWithValue

        public <T> JsonAssert hasPathWithValue​(String jsonPath,
                                               Object value)
        Ensure that a JSON path has the given value.