@Test public void shouldGetJustTheFirstInformation() { Headers headers = new ApacheHeaders(response, client); when(response.getHeaders("Content-Type")).thenReturn(headers()); assertEquals("text/html", headers.getMain("Content-Type")); }
public String getMain(String key) { return getFirst(key).split(";")[0]; }
ApacheHeaders implements Headers { public String getMain(String key) { return getFirst(key).split(";")[0]; } }
ApacheHeaders implements Headers { public String getMain(String key) { return getFirst(key).split(";")[0]; } ApacheHeaders(HttpResponse response, RestClient client); }
ApacheHeaders implements Headers { public String getMain(String key) { return getFirst(key).split(";")[0]; } ApacheHeaders(HttpResponse response, RestClient client); String getMain(String key); List<String> get(String key); String getFirst(String key); List<Link> getLinks(); Link getLink(String rel); Iterator<br.com.caelum.restfulie.http.Header> iterator(); }
ApacheHeaders implements Headers { public String getMain(String key) { return getFirst(key).split(";")[0]; } ApacheHeaders(HttpResponse response, RestClient client); String getMain(String key); List<String> get(String key); String getFirst(String key); List<Link> getLinks(); Link getLink(String rel); Iterator<br.com.caelum.restfulie.http.Header> iterator();  }