我在我放心的代码中收到“java.util.zip.ZipException:未知的压缩方法”

问题描述

我收到此错误“java.util.zip.ZipException:未知压缩方法”,但我正在处理 API 放心。会不会和pom.xml中的依赖有关?

我在谷歌上搜索了这个问题,刚刚看到它与 zip 文件有关,但正如您所见,没有 zip 编码。

这是我的代码和 pom.xml:

@Test
public void trelloCallTest() {
    String key = "mykey";
    String token = "mytoken";

    Response response = given()
        .spec(new RequestSpecBuilder().setBaseUri("https://api.trello.com/1").build())
        .contentType(ContentType.JSON)
        .log().all()
        .when()
        .queryParams("key",key,"token",token,"name","myname")
        .post("/boards/");

    String jsonString = response.asString();
    System.out.println(jsonString);

    response.then().statusCode(200);
}

这是我的 pom.xml:

<dependencies>
    <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-engine</artifactId>
        <version>5.5.2</version>
    </dependency>
    <dependency>
        <groupId>io.rest-assured</groupId>
        <artifactId>rest-assured</artifactId>
        <version>4.3.0</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json- 
             simple -->
    <dependency>
        <groupId>com.googlecode.json-simple</groupId>
        <artifactId>json-simple</artifactId>
        <version>1.1.1</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
    <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.8.6</version>
    </dependency>
    <dependency>
        <groupId>org.json</groupId>
        <artifactId>json</artifactId>
        <version>20210307</version>
    </dependency>
    <dependency>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
        <version>2.3.0</version>
    </dependency>
    <dependency>
        <groupId>org.codehaus.groovy</groupId>
        <artifactId>groovy-all</artifactId>
        <version>2.4.5</version>
    </dependency>
</dependencies>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)