Log, ak validácia zlyhá api

Príklady kódu

0
0

denník ak overenie zlyhá api

Log if validation fails
Since REST Assured 2.3.1 you can log the
request or response only if the validation fails.
To log the request do:

given().log().ifValidationFails(). ..
To log the response do:

.. .then().log().ifValidationFails(). ..
It's also possible to enable this for both
the request and the response at the same time using the LogConfig:

given().config(RestAssured.config().
logConfig(logConfig().enableLoggingO
fRequestAndResponseIfValidationFails(HEADERS))). ..
This will log only the headers if validation fails.

There's also a shortcut for enabling logging
of the request and response for all requests if validation fails:

RestAssured.enableLoggingOfRequestAndResponseIfValidationFails();

Podobné stránky

Podobné stránky s príkladmi

V iných jazykoch

Táto stránka je v iných jazykoch

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Íslensk
..................................................................................................................