@Test public void contextModification() { final HttpResponse.Builder b = new HttpResponse.Builder().withStatusCode(200).withContext("key1", "value1"); final HttpResponse response = b.build(); b.withContext("key2", "value2"); assertThat(response.getContext(), hasEntry("key1", "value1")); assertThat(response.getContext(), not(hasEntry("key2", "value2"))); }
@Override public Map<String, String> getContext() { return this.context; }
HttpResponse implements Response { @Override public Map<String, String> getContext() { return this.context; } }
HttpResponse implements Response { @Override public Map<String, String> getContext() { return this.context; } private  HttpResponse(final Builder builder); }
HttpResponse implements Response { @Override public Map<String, String> getContext() { return this.context; } private  HttpResponse(final Builder builder); @Override int getStatusCode(); @Override Map<String, String> headers(); @Override Body getBody(); @Override Map<String, String> getContext(); @Override RequestTimestamps getRequestTimestamps(); @Override String toString(); }
HttpResponse implements Response { @Override public Map<String, String> getContext() { return this.context; } private  HttpResponse(final Builder builder); @Override int getStatusCode(); @Override Map<String, String> headers(); @Override Body getBody(); @Override Map<String, String> getContext(); @Override RequestTimestamps getRequestTimestamps(); @Override String toString();  }