Get rest-assured request specifications as string

167
July 24, 2019, at 5:40 PM

I am trying to get all request details (request url, proxy, header, body etc) as a string since I need to redirect this to a logback log file. I have declared a common base class where I have declared the request variable (io.restassured.specification.RequestSpecification)

I use this base class in the default constructor for my stepDef classes. Each stepDef class has its only instance of log. I have tried using the solutions here: How to get rest-assured log into something printable in a text file but haven't succeeded

I've tried the following solutions:

  1. RestAssured.config = RestAssured.config().logConfig(new LogConfig(baseClass.loggerPrintStream.getPrintStream(), false));

  2. baseClass.request.config(RestAssured.config().logConfig(new LogConfig(baseClass.loggerPrintStream.getPrintStream(),true))).log().all();

  3. baseClass.request.filter(new RequestLoggingFilter(baseClass.loggerPrintStream.getPrintStream()));

None of the above seems to have done the trick for me. All I want is to get the complete request specification (baseClass.request) as a string so I can write the string to log file with a few more details.

READ ALSO
Why are RecyclerView rows being populated with same data?

Why are RecyclerView rows being populated with same data?

I'm trying to populate a RecyclerView using data stored in a ArrayListWhen the RecyclerView loads each piece of data is repeted 4x in each row

148
Which event/component allows side editing?

Which event/component allows side editing?

I'm developing an app in Android Studio and would like to use a component / event

110
Joi Validation : Conditionally validate one key based on the value of another key

Joi Validation : Conditionally validate one key based on the value of another key

I am trying to Joi validate one key depending on the value of another keyIn the following example ,I have tried to validate category_children based on has_sub_category's value

116
Problems with fetching div's ID

Problems with fetching div's ID

I have a problem with getting the div's ID from my applicationI have a JSP file, which generates a HTML

16