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 SummaryNested ClassesModifier and TypeClassDescriptionprotected static interfaceLets us be able to use lambda expressions that could throw checked exceptions, sinceXpathExpectationsHelperthrowsExceptionon its methods.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier 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- 
getBodySpecReturn the body spec.
- 
getXpathHelperReturn the XpathExpectationsHelper.
- 
getResponseHeadersSubclasses must implement this to provide access to response headers.
- 
getContentprotected abstract byte[] getContent()Subclasses must implement this to provide access to the response content.
- 
isEqualTo
- 
isEqualTo
- 
isEqualTo
- 
existsDelegates toXpathExpectationsHelper.exists(byte[], String).
- 
doesNotExistDelegates toXpathExpectationsHelper.doesNotExist(byte[], String).
- 
nodeCount
- 
string
- 
number
- 
nodeCount
- 
assertWith
- 
getCharset
- 
equals
- 
hashCode
 
-