public class MultipleNodeAssert extends org.assertj.core.api.FactoryBasedNavigableIterableAssert<MultipleNodeAssert,Iterable<Node>,Node,SingleNodeAssert>
Iterable of Node.
Simple Example
import static org.xmlunit.assertj.XmlAssert.assertThat;
final String xml = "<a><b attr=\"abc\"></b></a>";
assertThat(xml).nodesByXPath("//a/b").haveAttribute("attr").
| Modifier and Type | Method and Description |
|---|---|
MultipleNodeAssert |
containsAllNodesHavingXPath(String xPath)
Verifies that all of actual nodes have given
xPath. |
MultipleNodeAssert |
containsAnyNodeHavingXPath(String xPath)
Verifies that any of actual nodes has given
xPath. |
void |
doNotExist()
Equivalent for
AbstractIterableAssert.isEmpty(). |
MultipleNodeAssert |
doNotHaveAttribute(String attributeName)
Verifies that all the actual nodes don't have attribute with given name.
|
MultipleNodeAssert |
doNotHaveAttribute(String attributeName,
String attributeValue)
Verifies that all the actual nodes don't have attribute with given name and value.
|
MultipleNodeAssert |
exist()
Equivalent for
AbstractIterableAssert.isNotEmpty(). |
org.assertj.core.api.AbstractListAssert<?,List<? extends String>,String,org.assertj.core.api.ObjectAssert<String>> |
extractingAttribute(String attribute)
Extracting values of given node's attribute.
|
org.assertj.core.api.AbstractListAssert<?,List<? extends String>,String,org.assertj.core.api.ObjectAssert<String>> |
extractingText()
Extracting text content of given nodes.
|
MultipleNodeAssert |
haveAttribute(String attributeName)
Verifies that all the actual nodes have attribute with given name.
|
MultipleNodeAssert |
haveAttribute(String attributeName,
String attributeValue)
Verifies that all the actual nodes have attribute with given name and value.
|
are, areAtLeast, areAtLeastOne, areAtMost, areExactly, areNot, as, as, contains, containsAll, containsAnyElementsOf, containsAnyOf, containsExactly, containsExactlyElementsOf, containsExactlyInAnyOrder, containsExactlyInAnyOrderElementsOf, containsNull, containsOnly, containsOnlyElementsOf, containsOnlyNulls, containsOnlyOnce, containsSequence, containsSequence, containsSubsequence, containsSubsequence, describedAs, describedAs, doesNotContain, doesNotContainAnyElementsOf, doesNotContainNull, doesNotContainSequence, doesNotContainSequence, doesNotContainSubsequence, doesNotContainSubsequence, doesNotHave, doesNotHaveAnyElementsOfTypes, doesNotHaveDuplicates, doesNotHaveSameClassAs, doNotHave, element, endsWith, endsWith, extracting, extracting, extracting, extracting, extractingResultOf, extractingResultOf, filteredOn, filteredOn, filteredOn, filteredOnNull, first, flatExtracting, flatExtracting, flatExtracting, has, hasAtLeastOneElementOfType, hasOnlyElementsOfType, hasOnlyElementsOfTypes, hasSameClassAs, hasSameElementsAs, hasSameSizeAs, hasSameSizeAs, hasSize, hasToString, have, haveAtLeast, haveAtLeastOne, haveAtMost, haveExactly, inBinary, inHexadecimal, is, isEmpty, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isNot, isNotEmpty, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNullOrEmpty, isOfAnyClassIn, isSameAs, isSubsetOf, isSubsetOf, last, navigationDescription, newListAssertInstance, overridingErrorMessage, size, startsWith, toLazyIterable, usingComparator, usingComparatorForElementFieldsWithNames, usingComparatorForElementFieldsWithType, usingComparatorForType, usingComparisonStrategy, usingDefaultComparator, usingDefaultElementComparator, usingElementComparator, usingElementComparatorIgnoringFields, usingElementComparatorOnFields, usingFieldByFieldElementComparator, usingRecursiveFieldByFieldElementComparator, withFailMessage, withThreadDumpOnErrorpublic MultipleNodeAssert exist()
AbstractIterableAssert.isNotEmpty().public void doNotExist()
AbstractIterableAssert.isEmpty().public MultipleNodeAssert haveAttribute(String attributeName)
If the actual nodes iterable is empty, this assertion succeeds as there is no elements to check.
attributeName - name of the expected attributeAssertionError - if the actual nodes iterable is null.AssertionError - if one or more nodes don't have attribute with given name.public MultipleNodeAssert haveAttribute(String attributeName, String attributeValue)
If the actual nodes iterable is empty, this assertion succeeds as there is no elements to check.
attributeName - name of the expected attributeattributeValue - expected attribute valueAssertionError - if the actual nodes iterable is null.AssertionError - if one or more nodes don't have attribute with given name and value.public MultipleNodeAssert doNotHaveAttribute(String attributeName)
If the actual nodes iterable is empty, this assertion succeeds as there is no elements to check.
attributeName - name of the expected attributeAssertionError - if the actual nodes iterable is null.AssertionError - if any node has attribute with given name.public MultipleNodeAssert doNotHaveAttribute(String attributeName, String attributeValue)
If the actual nodes iterable is empty, this assertion succeeds as there is no elements to check.
attributeName - name of the expected attributeattributeValue - expected attribute valueAssertionError - if the actual nodes iterable is null.AssertionError - if any node has attribute with given name and value.public MultipleNodeAssert containsAnyNodeHavingXPath(String xPath)
xPath.xPath - XPath expression to testAssertionError - if the actual nodes iterable is null.AssertionError - if all nodes don't have xpath.public MultipleNodeAssert containsAllNodesHavingXPath(String xPath)
xPath.xPath - XPath expression to testAssertionError - if the actual nodes iterable is null.AssertionError - if some node doesn't have xpath.public org.assertj.core.api.AbstractListAssert<?,List<? extends String>,String,org.assertj.core.api.ObjectAssert<String>> extractingAttribute(String attribute)
null value is return.attribute - name of the attributeAssertionError - if the actual nodes iterable is null.public org.assertj.core.api.AbstractListAssert<?,List<? extends String>,String,org.assertj.core.api.ObjectAssert<String>> extractingText()
AssertionError - if the actual nodes iterable is null.Copyright © 2001–2025 XMLUnit. All rights reserved.