@Test public void should_return_empty_headers() { HttpHeadersProvider provider = new CompositeHttpHeadersProvider(emptyList()); HttpHeaders headers = provider.getHeaders(null); assertThat(headers.size()).isEqualTo(0); }
@Override public HttpHeaders getHeaders(Instance instance) { HttpHeaders headers = new HttpHeaders(); delegates.forEach(delegate -> headers.addAll(delegate.getHeaders(instance))); return headers; }
CompositeHttpHeadersProvider implements HttpHeadersProvider { @Override public HttpHeaders getHeaders(Instance instance) { HttpHeaders headers = new HttpHeaders(); delegates.forEach(delegate -> headers.addAll(delegate.getHeaders(instance))); return headers; } }
CompositeHttpHeadersProvider implements HttpHeadersProvider { @Override public HttpHeaders getHeaders(Instance instance) { HttpHeaders headers = new HttpHeaders(); delegates.forEach(delegate -> headers.addAll(delegate.getHeaders(instance))); return headers; } CompositeHttpHeadersProvider(Collection<HttpHeadersProvider> delegates); }
CompositeHttpHeadersProvider implements HttpHeadersProvider { @Override public HttpHeaders getHeaders(Instance instance) { HttpHeaders headers = new HttpHeaders(); delegates.forEach(delegate -> headers.addAll(delegate.getHeaders(instance))); return headers; } CompositeHttpHeadersProvider(Collection<HttpHeadersProvider> delegates); @Override HttpHeaders getHeaders(Instance instance); }
CompositeHttpHeadersProvider implements HttpHeadersProvider { @Override public HttpHeaders getHeaders(Instance instance) { HttpHeaders headers = new HttpHeaders(); delegates.forEach(delegate -> headers.addAll(delegate.getHeaders(instance))); return headers; } CompositeHttpHeadersProvider(Collection<HttpHeadersProvider> delegates); @Override HttpHeaders getHeaders(Instance instance);  }