@Test public void shouldAddNewHeadersWithoutDeleteTheExistingHeaders() { HttpUriRequest request = new HttpGet(); request.setHeader("X-UUID", "1111-111-111-111"); List<Header> headers = new ArrayList<>(1); headers.add(new BasicHeader("NEW-HEADER", "value")); factory.addHeaders(request, headers); assertEquals(2, request.getAllHeaders().length); assertEquals("1111-111-111-111", request.getFirstHeader("X-UUID").getValue()); assertEquals("value", request.getFirstHeader("NEW-HEADER").getValue()); }
@Override protected void addHeaders(HttpUriRequest httpRequest, List<Header> headers) { for (Header header : headers) { if (header.getValue() != null) { httpRequest.addHeader(header); } } }
HttpClientCougarRequestFactory extends CougarRequestFactory<HttpUriRequest> { @Override protected void addHeaders(HttpUriRequest httpRequest, List<Header> headers) { for (Header header : headers) { if (header.getValue() != null) { httpRequest.addHeader(header); } } } }
HttpClientCougarRequestFactory extends CougarRequestFactory<HttpUriRequest> { @Override protected void addHeaders(HttpUriRequest httpRequest, List<Header> headers) { for (Header header : headers) { if (header.getValue() != null) { httpRequest.addHeader(header); } } } HttpClientCougarRequestFactory(ContextEmitter<HttpUriRequest,List<Header>> emission); }
HttpClientCougarRequestFactory extends CougarRequestFactory<HttpUriRequest> { @Override protected void addHeaders(HttpUriRequest httpRequest, List<Header> headers) { for (Header header : headers) { if (header.getValue() != null) { httpRequest.addHeader(header); } } } HttpClientCougarRequestFactory(ContextEmitter<HttpUriRequest,List<Header>> emission);  }
HttpClientCougarRequestFactory extends CougarRequestFactory<HttpUriRequest> { @Override protected void addHeaders(HttpUriRequest httpRequest, List<Header> headers) { for (Header header : headers) { if (header.getValue() != null) { httpRequest.addHeader(header); } } } HttpClientCougarRequestFactory(ContextEmitter<HttpUriRequest,List<Header>> emission);   }