类 XpathResultMatchers
java.lang.Object
cn.taketoday.test.web.servlet.result.XpathResultMatchers
Factory for assertions on the response content using XPath expressions.
An instance of this class is typically accessed via
MockMvcResultMatchers.xpath(java.lang.String, java.lang.Object...).
- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明booleanValue(Boolean value) Evaluate the XPath and assert theBooleanvalue found.Evaluate the XPath and assert that content doesn't exist.exists()Evaluate the XPath and assert that content exists.private StringgetDefinedEncoding(MockHttpServletResponse response) Get the response encoding if explicitly defined in the response,nullotherwise.Evaluate the XPath and assert theNodecontent found with the given HamcrestMatcher.nodeCount(int expectedCount) Evaluate the XPath and assert the number of nodes found.Evaluate the XPath and assert the number of nodes found with the given HamcrestMatcher.Evaluate the XPath and assert theNodeListcontent found with the given HamcrestMatcher.Evaluate the XPath and assert theDoublevalue found.Evaluate the XPath and assert theDoublevalue found with the given HamcrestMatcher.Apply the XPath and assert theStringvalue found.Apply the XPath and assert theStringvalue found with the given HamcrestMatcher.
-
字段详细资料
-
xpathHelper
-
-
构造器详细资料
-
XpathResultMatchers
protected XpathResultMatchers(String expression, @Nullable Map<String, String> namespaces, Object... args) throws XPathExpressionExceptionProtected constructor, not for direct instantiation. UseMockMvcResultMatchers.xpath(String, Object...)orMockMvcResultMatchers.xpath(String, Map, Object...).- 参数:
expression- the XPath expressionnamespaces- the XML namespaces referenced in the XPath expression, ornullargs- arguments to parameterize the XPath expression with using the formatting specifiers defined inString.format(String, Object...)- 抛出:
XPathExpressionException
-
-
方法详细资料
-
node
Evaluate the XPath and assert theNodecontent found with the given HamcrestMatcher. -
nodeList
Evaluate the XPath and assert theNodeListcontent found with the given HamcrestMatcher. -
getDefinedEncoding
Get the response encoding if explicitly defined in the response,nullotherwise. -
exists
Evaluate the XPath and assert that content exists. -
doesNotExist
Evaluate the XPath and assert that content doesn't exist. -
nodeCount
Evaluate the XPath and assert the number of nodes found with the given HamcrestMatcher. -
nodeCount
Evaluate the XPath and assert the number of nodes found. -
string
Apply the XPath and assert theStringvalue found with the given HamcrestMatcher. -
string
Apply the XPath and assert theStringvalue found. -
number
Evaluate the XPath and assert theDoublevalue found with the given HamcrestMatcher. -
number
Evaluate the XPath and assert theDoublevalue found. -
booleanValue
Evaluate the XPath and assert theBooleanvalue found.
-