public class SingleNodeAssert extends org.assertj.core.api.AbstractAssert<SingleNodeAssert,org.w3c.dom.Node>
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").
Constructor and Description |
---|
SingleNodeAssert(org.w3c.dom.Node node) |
Modifier and Type | Method and Description |
---|---|
private java.util.Map.Entry<javax.xml.namespace.QName,java.lang.String> |
attributeForName(java.lang.String attributeName) |
SingleNodeAssert |
doesNotHaveAttribute(java.lang.String attributeName)
Verifies that node has not attribute with given name.
|
SingleNodeAssert |
doesNotHaveAttribute(java.lang.String attributeName,
java.lang.String attributeValue)
Verifies that node has not attribute with given name and value.
|
SingleNodeAssert |
hasAttribute(java.lang.String attributeName)
Verifies that node has attribute with given name.
|
SingleNodeAssert |
hasAttribute(java.lang.String attributeName,
java.lang.String attributeValue)
Verifies that node has attribute with given name and value.
|
private static boolean |
matchQName(javax.xml.namespace.QName qName,
java.lang.String name) |
as, as, asList, asString, describedAs, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, equals, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasToString, inBinary, inHexadecimal, is, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, overridingErrorMessage, satisfies, setCustomRepresentation, throwAssertionError, usingComparator, usingDefaultComparator, withFailMessage, withRepresentation, withThreadDumpOnError
public SingleNodeAssert hasAttribute(java.lang.String attributeName)
java.lang.AssertionError
- if the actual node is null
.java.lang.AssertionError
- if node has not attribute with given name.public SingleNodeAssert hasAttribute(java.lang.String attributeName, java.lang.String attributeValue)
java.lang.AssertionError
- if the actual node is null
.java.lang.AssertionError
- if node has not attribute with given name and value.public SingleNodeAssert doesNotHaveAttribute(java.lang.String attributeName)
java.lang.AssertionError
- if the actual node is null
.java.lang.AssertionError
- if node has attribute with given name.public SingleNodeAssert doesNotHaveAttribute(java.lang.String attributeName, java.lang.String attributeValue)
java.lang.AssertionError
- if the actual node is null
.java.lang.AssertionError
- if node has attribute with given name and value.private java.util.Map.Entry<javax.xml.namespace.QName,java.lang.String> attributeForName(java.lang.String attributeName)
private static boolean matchQName(javax.xml.namespace.QName qName, java.lang.String name)