Rest Assured - JSON Schema Validation - java.lang.NoSuchMethodError: com.github.fge.jsonschema.core.processing.CachingProcessor

Rest Assured - JSON Schema Validation - java.lang.NoSuchMethodError: com.github.fge.jsonschema.core.processing.CachingProcessor

我已为 JSON 响应生成架构并将其存储在项目目录中。

Response resp1 = req.post("/pet");
    resp1.prettyPeek();
    resp1.then().body(JsonSchemaValidator
            .matchesJsonSchema(new File("/Users/srirams/DemoWorkspace/RestAssuredTraining/PetStoreScehma.json")));

eclipse 中没有显示错误。但是当 运行 低于错误时。正如它所说的那样,它寻找的方法不存在。 但是我已经导入了它显示为丢失的 Jar。不确定我是否使用了错误的版本。

java.lang.NoSuchMethodError: com.github.fge.jsonschema.core.processing.CachingProcessor.

使用的依赖项是:

io.rest-assured->io.rest-assured 3.3.0.
io.rest-assured-> json-schema-validator 3.3.0.
json 20180130
com.github.fge ->json-schema-core 1.2.5

当我搜索答案时,我所能看到的只是添加了足以进行测试的放心和 json 模式验证程序库。但这对我不起作用。我的 dependencies/versions 有什么要更改的吗?任何建议都会很棒。

我用的就是这个版本,效果不错

<dependency>
    <groupId>io.rest-assured</groupId>
    <artifactId>rest-assured</artifactId>
    <version>4.3.3</version>
</dependency>

<dependency>
    <groupId>io.rest-assured</groupId>
    <artifactId>json-schema-validator</artifactId>
    <version>4.3.1</version>
</dependency>