Forum Discussion
12 years ago
I faced the same issue
also made a few observations
Consider sending 2 requests one right after another to the same mocked endpoint.
The following code successfully reads http response first time request is sent.
It is showing request body and says that ..getReader().ready()==true
For the second request ..getReader().ready()==false and request body is not shown.
However if I send the second request with 40 seconds delay - both first and second requests appear in log.
In case someone have ideas of how investigate or workaround please post below.
also made a few observations
Consider sending 2 requests one right after another to the same mocked endpoint.
The following code successfully reads http response first time request is sent.
It is showing request body and says that ..getReader().ready()==true
For the second request ..getReader().ready()==false and request body is not shown.
However if I send the second request with 40 seconds delay - both first and second requests appear in log.
log.info mockRequest.getRequest().getReader().ready()
try {
while ((line = mockRequest.getRequest().getReader().readLine()) != null)
log.info("line:"+line)
;
} catch (Exception e) {
log.error("exception:"+e)
}
In case someone have ideas of how investigate or workaround please post below.