簡體   English   中英

then()方法在REST保證下有什么作用?

[英]What does the then() method do in REST-assured?

我正在尋找then()方法在REST保證的API中做什么的正式定義,並且無法在javadocs中找到方法的說明。 它有什么作用?

參考: http : //static.javadoc.io/io.rest-assured/rest-assured/3.0.7/io/restassured/RestAssured.html

Get返回一個Response對象: http : //static.javadoc.io/io.rest-assured/rest-assured/3.0.7/io/restassured/response/Response.html

Response繼承以下接口:ResponseBody,ResponseBodyData,ResponseBodyExtractionOptions,ResponseOptions, Validatable

then是唯一Validatable方法: http : Validatable

但是,這通過使用ValidatableResponseOptions驅動了大多數事件驅動的驗證: http ://static.javadoc.io/io.rest-assured/rest-assured/3.0.7/io/restassured/response/ValidatableResponseOptions .html

在測試類中,這使您可以編寫專門用於驗證其余端點的測試,而不必對RestResponse進行比較繁瑣的拆包來評估響應的各個部分。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM