Skip to content
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

Change MockResponse body to Source. #1286

Merged
merged 1 commit into from
Jan 5, 2015
Merged

Conversation

JakeWharton
Copy link
Collaborator

No description provided.

@JakeWharton JakeWharton force-pushed the jw/response-body-source branch 2 times, most recently from 26aab7e to 87a1537 Compare January 5, 2015 02:06
@JakeWharton
Copy link
Collaborator Author

Sigh. More hanging tests.

* The number of bytes in {@linkplain #getBody() the body}. Note: this is not synonymous with
* {@code Content-Length} (e.g., in the case of chunked body).
*/
public long getBodySize() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we only ever compare this to 0. Perhaps instead we could just have a null response from body source? The fact that this doesn't line up with Content-Length is ugly.

@swankjesse
Copy link
Collaborator

LGTM

@JakeWharton JakeWharton force-pushed the jw/response-body-source branch 6 times, most recently from a46c191 to 7d1c7e1 Compare January 5, 2015 05:06
@JakeWharton
Copy link
Collaborator Author

I went full-buffer which means you can stream anymore. Do we care?

The problem is that some tests re-enqueue the same MockResponse instance for multiple requests. This worked if and only if you were using a Buffer/byte[] but not if you were specifying an InputStream (which nobody was internally). Do we need to support one-shot streaming responses?

@swankjesse
Copy link
Collaborator

Let's kill one-shot streaming responses. They were there for testing large payloads.

JakeWharton added a commit that referenced this pull request Jan 5, 2015
Change MockResponse body to Source.
@JakeWharton JakeWharton merged commit ddbf236 into master Jan 5, 2015
@JakeWharton JakeWharton deleted the jw/response-body-source branch January 5, 2015 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants