I'm trying to figure out how to log raw response in a mock AfterRequest. I don't want to have any such code for particular operations, having code in mock is better maintainable and efficient. So I have no chance for test step or assertion.
How do i access messageExchange?
This code doesn't work! Grabs just one response header and causes random errors during execution.
mockResult.getMockResponse().getResponseHeaders().toString()
The .toXml() call will work but displays only limited headers. So this is probably a bug.
The same command works perfect for requests:
mockResult.getMockRequest().getRequestHeaders().toString()
it will write down all headers in a perfect text format.