Package org.springframework.test.json
Class AbstractJsonValueAssert<SELF extends AbstractJsonValueAssert<SELF>>
java.lang.Object
org.assertj.core.api.AbstractAssert<SELF,ACTUAL>
 
org.assertj.core.api.AbstractObjectAssert<SELF,Object>
 
org.springframework.test.json.AbstractJsonValueAssert<SELF>
- Type Parameters:
- SELF- the type of assertions
- All Implemented Interfaces:
- org.assertj.core.api.Assert<SELF,,- Object> - org.assertj.core.api.Descriptable<SELF>,- org.assertj.core.api.ExtensionPoints<SELF,- Object> 
- Direct Known Subclasses:
- JsonPathValueAssert
public abstract class AbstractJsonValueAssert<SELF extends AbstractJsonValueAssert<SELF>>
extends org.assertj.core.api.AbstractObjectAssert<SELF,Object> 
Base AssertJ assertions that can be
 applied to a JSON value.
 
In JSON, values must be one of the following data types:
This base class offers direct access for each of those types as well as conversion methods based on an optionalGenericHttpMessageConverter.- Since:
- 6.2
- Author:
- Stephane Nicoll
- 
Field SummaryFields inherited from class org.assertj.core.api.AbstractAssertactual, info, myself, objects, throwUnsupportedExceptionOnEquals
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedAbstractJsonValueAssert(Object actual, Class<?> selfType, HttpMessageContentConverter contentConverter) 
- 
Method SummaryModifier and TypeMethodDescriptionorg.assertj.core.api.ObjectArrayAssert<Object>asArray()Verify that the actual value is a non-nullarray, and return a new assertion object that provides dedicated array assertions for it.org.assertj.core.api.AbstractBooleanAssert<?>Verify that the actual value is a non-nullBoolean, and return a new assertion object that provides dedicatedBooleanassertions for it.asMap()Verify that the actual value is a non-nullJSON object, and return a new assertion object that provides dedicated assertions on individual elements of the object.org.assertj.core.api.AbstractObjectAssert<?,Number> asNumber()org.assertj.core.api.AbstractStringAssert<?>asString()Verify that the actual value is a non-nullString, and return a new assertion object that provides dedicatedStringassertions for it.<T> org.assertj.core.api.AbstractObjectAssert<?,T> Verify that the actual value can be converted to an instance of the giventarget, and produce a new assertion object narrowed to that type.<ASSERT extends org.assertj.core.api.AbstractAssert<?,?>> 
 ASSERTconvertTo(org.assertj.core.api.AssertFactory<?, ASSERT> assertFactory) Verify that the actual value can be converted to an instance of the type defined by the givenAssertFactoryand return a new Assert narrowed to that type.protected StringisEmpty()Verify that the actual value is empty: either anullscalar value or an empty list or map.Verify that the actual value is not empty: either a non-nullscalar value or a non-empty list or map.Methods inherited from class org.assertj.core.api.AbstractObjectAssertas, as, doesNotReturn, extracting, extracting, extracting, extracting, extracting, extracting, extractingForProxy, getComparatorsByType, hasAllNullFieldsOrProperties, hasAllNullFieldsOrPropertiesExcept, hasFieldOrProperty, hasFieldOrPropertyWithValue, hasNoNullFieldsOrProperties, hasNoNullFieldsOrPropertiesExcept, hasOnlyFields, isEqualToComparingFieldByField, isEqualToComparingFieldByFieldRecursively, isEqualToComparingOnlyGivenFields, isEqualToIgnoringGivenFields, isEqualToIgnoringNullFields, newObjectAssert, returns, usingComparatorForFields, usingComparatorForType, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparisonMethods inherited from class org.assertj.core.api.AbstractAssertactual, areEqual, asInstanceOf, asList, assertionError, 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, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnErrorMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.assertj.core.api.Descriptableas, describedAs, describedAs
- 
Constructor Details- 
AbstractJsonValueAssertprotected AbstractJsonValueAssert(@Nullable Object actual, Class<?> selfType, @Nullable HttpMessageContentConverter contentConverter) 
 
- 
- 
Method Details- 
asStringpublic org.assertj.core.api.AbstractStringAssert<?> asString()Verify that the actual value is a non-nullString, and return a new assertion object that provides dedicatedStringassertions for it.- Specified by:
- asStringin interface- org.assertj.core.api.Assert<SELF extends AbstractJsonValueAssert<SELF>,- Object> 
- Overrides:
- asStringin class- org.assertj.core.api.AbstractAssert<SELF extends AbstractJsonValueAssert<SELF>,- Object> 
 
- 
asNumber
- 
asBooleanpublic org.assertj.core.api.AbstractBooleanAssert<?> asBoolean()Verify that the actual value is a non-nullBoolean, and return a new assertion object that provides dedicatedBooleanassertions for it.
- 
asArrayVerify that the actual value is a non-nullarray, and return a new assertion object that provides dedicated array assertions for it.
- 
asMapVerify that the actual value is a non-nullJSON object, and return a new assertion object that provides dedicated assertions on individual elements of the object.The returned map assertion object uses attribute names as the keys, and the values can be any of the valid JSON values. 
- 
convertToVerify that the actual value can be converted to an instance of the giventarget, and produce a new assertion object narrowed to that type.- Parameters:
- target- the type to convert the actual value to
 
- 
convertTopublic <ASSERT extends org.assertj.core.api.AbstractAssert<?,?>> ASSERT convertTo(org.assertj.core.api.AssertFactory<?, ASSERT> assertFactory) Verify that the actual value can be converted to an instance of the type defined by the givenAssertFactoryand return a new Assert narrowed to that type.InstanceOfAssertFactoriesprovides static factories for all the types supported byAssertions.assertThat(java.util.function.Predicate<T>). Additional factories can be created by implementingAssertFactory.Example: // Check that the json value is an array of 3 users assertThat(jsonValue).convertTo(InstanceOfAssertFactories.list(User.class)) hasSize(3); // ListAssert of User- Parameters:
- assertFactory- the- AssertFactoryto use to produce a narrowed Assert for the type that it defines.
 
- 
isEmptyVerify that the actual value is empty: either anullscalar value or an empty list or map.Can also be used when the path uses a filter operator to validate that it did not match. 
- 
isNotEmptyVerify that the actual value is not empty: either a non-nullscalar value or a non-empty list or map.Can also be used when the path uses a filter operator to validate that it did match at least one element. 
- 
getExpectedErrorMessagePrefix
 
-