【发布时间】:2021-04-09 23:33:53
【问题描述】:
我已经导入了运行 RestAssured 程序所需的所有 jar。但是面临这个错误。
import io.restassured.RestAssured;
导入静态 io.restassured.RestAssured.*; 公共类基础{
public static void main(String[] args) {
// TODO Auto-generated method stub
RestAssured.baseURI="https://rahulshettyacademy.com";
given().log().all().queryParam("key", "qaclick123").header("Content-Type","application/json")
.body("{\r\n"
+ " \"location\": {\r\n"
+ " \"lat\": -38.383494,\r\n"
+ " \"lng\": 33.427362\r\n"
+ " },\r\n"
+ " \"accuracy\": 50,\r\n"
+ " \"name\": \"Frontline house\",\r\n"
+ " \"phone_number\": \"(+91) 983 893 3937\",\r\n"
+ " \"address\": \"29, side layout, cohen 09\",\r\n"
+ " \"types\": [\r\n"
+ " \"shoe park\",\r\n"
+ " \"shop\"\r\n"
+ " ],\r\n"
+ " \"website\": \"http://google.com\",\r\n"
+ " \"language\": \"French-IN\"\r\n"
+ "}\r\n"
+ "\r\n"
+ "").when().post("maps/api/place/add/json").then().assertThat().statusCode(200);
}
}
【问题讨论】:
-
你如何管理你的进口?马文?摇篮?将 .jar 文件导入项目?此错误表明您缺少依赖项
标签: java api rest automation rest-assured