HttpURLConnectionHttpChannel implements HttpChannel { public void setHeader(String name, String value) throws IOException { con.setRequestProperty(name, value); } HttpURLConnectionHttpChannel(HttpURLConnection con, MethodType methodType); void setSocketTimeout(int timeout); void setConnectionTimeout(int timeout); void setHeader(String name, String value); void addHeader(String name, String value); void setContentType(String value); void setAccept(String value); void writeEntityWith(HttpEntityWriter httpEntityWriter); Response send();  }
@Test public void setHeaderShouldSetItIntoHttpUrlConnection() throws IOException { toTest.setHeader("name", "value"); verify(httpURLConnection).setRequestProperty("name", "value"); }