类 DefaultWebTestClient.DefaultBodyContentSpec
java.lang.Object
cn.taketoday.test.web.reactive.server.DefaultWebTestClient.DefaultBodyContentSpec
- 所有已实现的接口:
WebTestClient.BodyContentSpec
- 封闭类:
- DefaultWebTestClient
private static class DefaultWebTestClient.DefaultBodyContentSpec
extends Object
implements WebTestClient.BodyContentSpec
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明consumeWith(Consumer<EntityExchangeResult<byte[]>> consumer) Assert the response body content with the givenConsumer.private StringisEmpty()Assert the response body is empty and return the exchange result.Parse the expected and actual response content as JSON and perform a comparison verifying that they contain the same attribute-value pairs regardless of formatting.Access to response body assertions using a JsonPath expression to inspect a specific subset of the body.EntityExchangeResult<byte[]>Exit the chained API and return anExchangeResultwith the raw response content.Parse expected and actual response content as XML and assert that the two are "similar", i.e. they contain the same elements and attributes regardless of order.Access to response body assertions with specific namespaces using an XPath expression to inspect a specific subset of the body.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 cn.taketoday.test.web.reactive.server.WebTestClient.BodyContentSpec
json, xpath
-
字段详细资料
-
result
-
isEmpty
private final boolean isEmpty
-
-
构造器详细资料
-
DefaultBodyContentSpec
DefaultBodyContentSpec(EntityExchangeResult<byte[]> result)
-
-
方法详细资料
-
isEmpty
从接口复制的说明:WebTestClient.BodyContentSpecAssert the response body is empty and return the exchange result.- 指定者:
isEmpty在接口中WebTestClient.BodyContentSpec
-
json
从接口复制的说明:WebTestClient.BodyContentSpecParse the expected and actual response content as JSON and perform a comparison verifying that they contain the same attribute-value pairs regardless of formatting.Can compare in two modes, depending on the
strictparameter value:true: strict checking. Not extensible and strict array ordering.false: lenient checking. Extensible and non-strict array ordering.
Use of this method requires the JSONassert library to be on the classpath.
- 指定者:
json在接口中WebTestClient.BodyContentSpec- 参数:
json- the expected JSON contentstrict- enables strict checking iftrue- 另请参阅:
-
xml
从接口复制的说明:WebTestClient.BodyContentSpecParse expected and actual response content as XML and assert that the two are "similar", i.e. they contain the same elements and attributes regardless of order.Use of this method requires the XMLUnit library on the classpath.
- 指定者:
xml在接口中WebTestClient.BodyContentSpec- 参数:
expectedXml- the expected JSON content.- 另请参阅:
-
jsonPath
从接口复制的说明:WebTestClient.BodyContentSpecAccess to response body assertions using a JsonPath expression to inspect a specific subset of the body.The JSON path expression can be a parameterized string using formatting specifiers as defined in
String.format(java.lang.String, java.lang.Object...).- 指定者:
jsonPath在接口中WebTestClient.BodyContentSpec- 参数:
expression- the JsonPath expressionargs- arguments to parameterize the expression
-
xpath
public XpathAssertions xpath(String expression, @Nullable Map<String, String> namespaces, Object... args) 从接口复制的说明:WebTestClient.BodyContentSpecAccess to response body assertions with specific namespaces using an XPath expression to inspect a specific subset of the body.The XPath expression can be a parameterized string using formatting specifiers as defined in
String.format(java.lang.String, java.lang.Object...).- 指定者:
xpath在接口中WebTestClient.BodyContentSpec- 参数:
expression- the XPath expressionnamespaces- the namespaces to useargs- arguments to parameterize the expression
-
getBodyAsString
-
consumeWith
从接口复制的说明:WebTestClient.BodyContentSpecAssert the response body content with the givenConsumer.- 指定者:
consumeWith在接口中WebTestClient.BodyContentSpec- 参数:
consumer- the consumer for the response body; the inputbyte[]may benullif there was no response body.
-
returnResult
从接口复制的说明:WebTestClient.BodyContentSpecExit the chained API and return anExchangeResultwith the raw response content.- 指定者:
returnResult在接口中WebTestClient.BodyContentSpec
-