Interface ObjectNodeDsl<A>
- Type Parameters:
A- the assertion type
- All Known Subinterfaces:
JsonNodeAssertDsl<A>
- All Known Implementing Classes:
AssertJson,ConditionList,CoreJsonAssertion,HamcrestJsonAssertion,HamcrestJsonAssertionBuilder,JsonAssertDslBuilders.At,ObjectNodes,PathDsl
Assertions specific to object nodes
-
Method Summary
Modifier and TypeMethodDescriptiondefault AcontainsKey(String key) Assert that the value contains a key/fielddefault AcontainsKeys(String key, String... keys) Assert that the value contains multiple keys/fieldsdefault AcontainsKeysExactly(String key, String... keys) Assert that the value contains multiple keys/fields, no more, no less, order maintained.default AcontainsKeysExactlyInAnyOrder(String key, String... keys) Assert that the value contains multiple keys/fields, no more, no less, any orderdefault AdoesNotContainKey(String key) Assert that the value does not contain a key/fielddefault AdoesNotContainKeys(String key, String... keys) Assert that the value does not contain multiple keys/fieldsdefault AAssert that the value is not an objectdefault AisObject()Assert that the value is an objectdefault AsatisfiesObjectCondition(Condition condition) Assert that the value is an object, meeting an additional condition
-
Method Details
-
satisfiesObjectCondition
Assert that the value is an object, meeting an additional condition- Parameters:
condition- the number condition- Returns:
- the assertion for fluent assertions, with this condition added
-
isObject
Assert that the value is an object- Returns:
- the assertion for fluent assertions, with this condition added
-
isNotObject
Assert that the value is not an object- Returns:
- the assertion for fluent assertions, with this condition added
-
containsKey
Assert that the value contains a key/field- Parameters:
key- the key to search for- Returns:
- the assertion for fluent assertions, with this condition added
-
doesNotContainKey
Assert that the value does not contain a key/field- Parameters:
key- the key to search for- Returns:
- the assertion for fluent assertions, with this condition added
-
containsKeys
Assert that the value contains multiple keys/fields- Parameters:
key- the first key to search forkeys- the remaining keys to search for- Returns:
- the assertion for fluent assertions, with this condition added
-
doesNotContainKeys
Assert that the value does not contain multiple keys/fields- Parameters:
key- the first key to search forkeys- the remaining keys to search for- Returns:
- the assertion for fluent assertions, with this condition added
-
containsKeysExactly
Assert that the value contains multiple keys/fields, no more, no less, order maintained. This should be used instead ofcontainsKey(String)to mean contains only the key.- Parameters:
key- the first key to search forkeys- the remaining keys to search for- Returns:
- the assertion for fluent assertions, with this condition added
-
containsKeysExactlyInAnyOrder
Assert that the value contains multiple keys/fields, no more, no less, any order- Parameters:
key- the first key to search forkeys- the remaining keys to search for- Returns:
- the assertion for fluent assertions, with this condition added
-