rest - Json Schema Validation Not Fail -


i working on json schema valdation rest assured api. getting json response web service , validate a schema. when change property in schema , run test code, test not fail. wanna test property exist there. if 1 of properties in schema not exist in response test must fail. couldn't this. how can this? test code:

@test public void catalogbutiquedetailtest(){     file file = new file("src/test/resources/generatedjson/boutiquedetailschema.json");     jsonschemafactory jsonschemafactory = jsonschemafactory.newbuilder().setvalidationconfiguration(validationconfiguration.newbuilder().setdefaultversion(schemaversion.draftv4).freeze()).freeze();       given()     .headers("some-header-info")     .contenttype("application/json")     .get("web-service-url")     .then()     .assertthat()     .body(jsonschemavalidator.matchesjsonschema(file).using(jsonschemafactory)); } 

in schema add these properties:

"required": ["prop1", "prop2", ...], "additionalproperties": false 

Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -