![](/img/trans.png)
[英]What is the difference between io.rest-assured vs jayway rest-assured?
[英]What is the difference between given() and with() in Rest Assured?
RequestSpecification request1 = RestAssured.given();
// Setting Base URI
request1.baseUri("https://restful-booker.herokuapp.com");
// Setting Base Path
request1.basePath("/booking");
// Creating request specification using with()
RequestSpecification request2 = RestAssured.with();
// Setting Base URI
request2.baseUri("https://restful-booker.herokuapp.com");
// Setting Base Path
request2.basePath("/ping");
在这里我们同时使用两者有什么区别?
方法:“and”、“with”、“when”、“given”、“that”和“request”是 RequestSpecification 的同步糖,您不需要它们来创建 RequestSpecification object。
package com.jayway.restassured 表明with()
和given()
做同样的事情。
public static RequestSpecification with() {
return given();
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.