ZE
Size: a a a
ZE
ЖR
MK
i
boolean validation = helperReq.validationSchema
(ERROR_SCHEMA_FOR_0_1_2_SYMBOLS_JSON, jsonObject);
assertTrue(validation,"Response must match the ErrorSchema,\n"
+"Response Expected: "+ jsonExpected+"\n"
+"Responce Actual: "+ jsonObject);
i
boolean validation = helperReq.validationSchema
(ERROR_SCHEMA_FOR_0_1_2_SYMBOLS_JSON, jsonObject);
assertTrue(validation,"Response must match the ErrorSchema,\n"
+"Response Expected: "+ jsonExpected+"\n"
+"Responce Actual: "+ jsonObject);
public static boolean validationSchema(String pathToSchema, org.json.JSONObject json) {
org.json.JSONObject jsonSchema = new org.json.JSONObject
(new JSONTokener(String.valueOf(getJSONfromJSONFile(pathToSchema))));
Schema schema = SchemaLoader.load(jsonSchema);
try {
schema.validate(json);
return true;
} catch (ValidationException e) {
return false;
}
}
i
EB
ЖR
EB
boolean validation = helperReq.validationSchema
(ERROR_SCHEMA_FOR_0_1_2_SYMBOLS_JSON, jsonObject);
assertTrue(validation,"Response must match the ErrorSchema,\n"
+"Response Expected: "+ jsonExpected+"\n"
+"Responce Actual: "+ jsonObject);
// some code before
helperReq.validateSchema(SCHEMA)
// some code after
EB
i
// some code before
helperReq.validateSchema(SCHEMA)
// some code after
i
MK
B
MK
B
B
i
public static void validationSchemaV2(String pathToSchema, JSONObject json) {
org.json.JSONObject jsonSchema = new org.json.JSONObject
(new JSONTokener(String.valueOf(getJSONfromJSONFile(pathToSchema))));
Schema schema = SchemaLoader.load(jsonSchema);
schema.validate(json);
}
i
@Test
public void test2() {
org.json.JSONObject jsonResponse = helperReq.sendRequestGetJSON(PATH,"");
helperReq.validationSchemaV2(BASE_SCHEMA,jsonResponse);
}
i