square/okhttp — pull request #563 by adriancole (2014-02-24 00:48:46+00:00)
Title: Teach MockWebServer HTTP/2 Push Promise

need some advice on what we want the caller syntax to be. Below is the raw "what we need"

```java
MockResponse response = new MockResponse().setBody("ABCDE").setStatus("HTTP/1.1 200 Sweet")
.withPush(new PushPromise("GET", "/foo/bar", Arrays.asList("foo: bar"),
new MockResponse().setBody("bar").setStatus("HTTP/1.1 200 Sweet")));
```

push promises can only be HEAD or GET, and never send a request body. In this case, we could make some syntactic sugar.. such as.

```java
MockResponse response = new MockResponse().setBody("ABCDE").setStatus("HTTP/1.1 200 Sweet")
// add 2 methods that hide the PushPromise object: pushHead and pushGet
.pushGet("/foo/bar", Arrays.asList("foo: bar"),
new MockResponse().setBody("bar").setStatus("HTTP/1.1 200 Sweet"));
```

or

```java
MockResponse response = new MockResponse().setBody("ABCDE").setStatus("HTTP/1.1 200 Sweet")
// hide creation of PushPromise object
.push("GET", "/foo/bar", Arrays.asList("foo: bar"),
new MockResponse().setBody("bar").setStatus("HTTP/1.1 200 Sweet"));
```