Class AbstractXpathAssertions<B>
java.lang.Object
org.springframework.test.web.support.AbstractXpathAssertions<B>
- Type Parameters:
B- the type of body spec (RestTestClient vs WebTestClient specific)
- Direct Known Subclasses:
XpathAssertions, XpathAssertions
Base class for applying XPath assertions in RestTestClient and WebTestClient.
- Since:
- 7.0
- Author:
- Rob Worsnop, Rossen Stoyanchev
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceLets us be able to use lambda expressions that could throw checked exceptions, sinceXpathExpectationsHelperthrowsExceptionon its methods. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected BDelegates toXpathExpectationsHelper.doesNotExist(byte[], String).booleanexists()Delegates toXpathExpectationsHelper.exists(byte[], String).protected BReturn the body spec.protected Stringprotected abstract byte[]Subclasses must implement this to provide access to the response content.protected abstract Optional<HttpHeaders> Subclasses must implement this to provide access to response headers.protected XpathExpectationsHelperReturn the XpathExpectationsHelper.inthashCode()isEqualTo(boolean expectedValue) nodeCount(int expectedCount) Consume the count of nodes as result of the XPath evaluation.Consume the result of the XPath evaluation as a Double.Consume the result of the XPath evaluation as a String.
-
Constructor Details
-
AbstractXpathAssertions
-
-
Method Details
-
getBodySpec
Return the body spec. -
getXpathHelper
Return the XpathExpectationsHelper. -
getResponseHeaders
Subclasses must implement this to provide access to response headers. -
getContent
protected abstract byte[] getContent()Subclasses must implement this to provide access to the response content. -
isEqualTo
-
isEqualTo
-
isEqualTo
-
exists
Delegates toXpathExpectationsHelper.exists(byte[], String). -
doesNotExist
Delegates toXpathExpectationsHelper.doesNotExist(byte[], String). -
nodeCount
-
string
-
number
-
nodeCount
-
assertWith
-
getCharset
-
equals
-
hashCode
-