首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Maven编译错误“包io.restassured.specification不存在”

Maven编译错误“包io.restassured.specification不存在”
EN

Stack Overflow用户
提问于 2020-05-25 19:51:27
回答 1查看 1.1K关注 0票数 1

我已经从"https://github.com/rest-assured/rest-assured/wiki/Downloads“(前6位)导入了jar文件,并且,我已经导入了静态类”ImportStaticio.Restassured.Restised.*“,但仍然得到了这个编译错误。除了上面的错误,我还得到了这个错误“包io.restassured不存在”。

另外,我的Maven依赖性如下:

代码语言:javascript
复制
<!-- rest assured library for API-level testing -->
<dependency>
  <groupId>io.rest-assured</groupId>
  <artifactId>rest-assured</artifactId>
  <version>4.3.0</version>
  <scope>test</scope>
</dependency>

<!-- https://mvnrepository.com/artifact/io.rest-assured/json-path -->
<dependency>
  <groupId>io.rest-assured</groupId>
  <artifactId>json-path</artifactId>
  <version>3.0.3</version>
</dependency>

<!-- to validate that a JSON response conforms to a Json Schema -->
<dependency>
  <groupId>io.rest-assured</groupId>
  <artifactId>json-schema-validator</artifactId>
  <version>3.0.2</version>
</dependency>

代码片段:

代码语言:javascript
复制
public static List<String> passParams(List<String> list){
    RestAssured.baseURI = freightRootURL;
    RequestSpecification requestSpecification = given();
    for (int i = 0; i < list.size() ; i ++ ) {
        requestSpecification = requestSpecification.queryParam(freightParams.get(i), list.get(i));
    }
    String result = requestSpecification.when().get().then().assertThat().statusCode(200).extract().response().asString();

    JsonPath js = new JsonPath(result);
    String offers = js.getString("offers.key");

    return Arrays.asList(offers.split(","));
EN

回答 1

Stack Overflow用户

发布于 2022-03-17 07:25:09

添加依赖项解决了这个问题。

https://code.quarkus.io/中使用stsarter projec,然后添加依赖项。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62009724

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档