-
Notifications
You must be signed in to change notification settings - Fork 9.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request entity tests for the Apache client shim. #232
Conversation
|
private final Deque<RecordedRequest> requests = new ArrayDeque<RecordedRequest>(); | ||
|
||
@Override public MockResponse dispatch(RecordedRequest request) throws InterruptedException { | ||
requests.add(request); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't necessary; the mockwebserver itself records requests. Call server.takeRequest()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the behavior is a bit different because requests without corresponding queued responses are not themselves queued for the take request method. That means that I'd have to call take request (which would block) and then spawn a new thread in the test to make the request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha. In that case just enqueue a response?
Updated and still passing. |
LGTM |
Request entity tests for the Apache client shim.
Refs #221.