REST JSON Schema Health Check Complete

I work with Spring Boot and REST Assured to test the REST API. I tried an example with checking JSON schema, but this causes this error:

java.lang.IllegalArgumentException: Schema to use cannot be null

According to the documentation, the circuit should be located on the class path . The outline of my example is there. Here is my project structure and layout layout example:

project structure

Here is my code. Without checking the circuit, it works great.

given().
    contentType("application/json").
when().
    get("http://myExample/users").
then().
    assertThat().body(matchesJsonSchemaInClasspath("example_schema.json"));
+4
source share
1 answer

rest.resource, , matchesJsonSchemaInClasspath. (, src/test/resources), , matchesJsonSchemaInClasspath.

+6

Source: https://habr.com/ru/post/1613729/


All Articles