mardi 5 février 2019

Get the "CURL" operation from each Rest Assured test and print in the console when not pass the test

I need Get the "CURL" operation from each Rest Assured test and print in the console when not pass the test. It's possible?

For axample, convert:

 given().relaxedHTTPSValidation().
   auth().basic("name", "password").
   param("grant_type","client_credentials").
 when().
   post("https://test_url/oauth/token").
 then().
   statusCode(200);

to

curl --user name:passwoed -k -X POST \
https://test_url/oauth/token \
-H 'cache-control: no-cache' \
-H 'content-type: application/x-www-form-urlencoded' \
-d grant_type=client_credentials

Aucun commentaire:

Enregistrer un commentaire