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:
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"));
source
share