Package org.xmlunit.assertj3
Class SingleNodeAssert
java.lang.Object
org.assertj.core.api.AbstractAssert<SingleNodeAssert,Node>
org.xmlunit.assertj3.SingleNodeAssert
- All Implemented Interfaces:
org.assertj.core.api.Assert<SingleNodeAssert,
,Node> org.assertj.core.api.Descriptable<SingleNodeAssert>
,org.assertj.core.api.ExtensionPoints<SingleNodeAssert,
Node>
Assertion methods for
Node
.
Simple Example
import static org.xmlunit.assertj.XmlAssert.assertThat; final String xml = "<a><b attr=\"abc\"></b></a>"; assertThat(xml).nodesByXPath("//a/b").first().hasAttribute("attr", "abc").
- Since:
- XMLUnit 2.8.1
-
Field Summary
FieldsFields inherited from class org.assertj.core.api.AbstractAssert
actual, info, myself, objects, throwUnsupportedExceptionOnEquals
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoesNotHaveAttribute
(String attributeName) Verifies that the actual node has not attribute with given name.doesNotHaveAttribute
(String attributeName, String attributeValue) Verifies that the actual node has not attribute with given name and value.hasAttribute
(String attributeName) Verifies that the actual node has attribute with given name.hasAttribute
(String attributeName, String attributeValue) Verifies that the actual node has attribute with given name and value.Verifies that the actual node or any child node matches givenxPath
.(package private) boolean
isNodeSetEmpty
(String xPath) Methods inherited from class org.assertj.core.api.AbstractAssert
asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, 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, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOf, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, 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
-
Field Details
-
engine
-
-
Constructor Details
-
SingleNodeAssert
SingleNodeAssert(Node node, JAXPXPathEngine engine)
-
-
Method Details
-
hasAttribute
Verifies that the actual node has attribute with given name.- Throws:
AssertionError
- if the actual node isnull
.AssertionError
- if node has not attribute with given name.
-
hasAttribute
Verifies that the actual node has attribute with given name and value.- Throws:
AssertionError
- if the actual node isnull
.AssertionError
- if node has not attribute with given name and value.
-
doesNotHaveAttribute
Verifies that the actual node has not attribute with given name.- Throws:
AssertionError
- if the actual node isnull
.AssertionError
- if node has attribute with given name.
-
doesNotHaveAttribute
Verifies that the actual node has not attribute with given name and value.- Throws:
AssertionError
- if the actual node isnull
.AssertionError
- if node has attribute with given name and value.
-
hasXPath
Verifies that the actual node or any child node matches givenxPath
. The actual node is the root forxPath
.- Throws:
AssertionError
- if the actual node isnull
.AssertionError
- if node has attribute with given name and value.- Since:
- XMLUnit 2.6.4
-
isNodeSetEmpty
-