@Test public void shouldGetHeaders() { MultiMap originalHeaders = new VertxHttpHeaders() .add("key1", "value1") .add("key1", "value2") .add("key2", "value3"); given(mockDelegate.headers()).willReturn(originalHeaders); HttpHeaders expectedHeaders = new HttpHeaders(); expectedHeaders.add("key1", "value1"); expectedHeaders.add("key1", "value2"); expectedHeaders.add("key2", "value3"); VertxClientHttpResponse response = new VertxClientHttpResponse(mockDelegate, Flux.empty()); HttpHeaders actualHeaders = response.getHeaders(); assertThat(actualHeaders).isEqualTo(expectedHeaders); }
@Override public HttpHeaders getHeaders() { HttpHeaders headers = new HttpHeaders(); delegate.headers() .forEach(e -> headers.add(e.getKey(), e.getValue())); return headers; }
VertxClientHttpResponse implements ClientHttpResponse { @Override public HttpHeaders getHeaders() { HttpHeaders headers = new HttpHeaders(); delegate.headers() .forEach(e -> headers.add(e.getKey(), e.getValue())); return headers; } }
VertxClientHttpResponse implements ClientHttpResponse { @Override public HttpHeaders getHeaders() { HttpHeaders headers = new HttpHeaders(); delegate.headers() .forEach(e -> headers.add(e.getKey(), e.getValue())); return headers; } VertxClientHttpResponse(HttpClientResponse delegate, Flux<DataBuffer> body); }
VertxClientHttpResponse implements ClientHttpResponse { @Override public HttpHeaders getHeaders() { HttpHeaders headers = new HttpHeaders(); delegate.headers() .forEach(e -> headers.add(e.getKey(), e.getValue())); return headers; } VertxClientHttpResponse(HttpClientResponse delegate, Flux<DataBuffer> body); @Override int getRawStatusCode(); @Override HttpStatus getStatusCode(); @Override Flux<DataBuffer> getBody(); @Override HttpHeaders getHeaders(); @Override MultiValueMap<String, ResponseCookie> getCookies(); }
VertxClientHttpResponse implements ClientHttpResponse { @Override public HttpHeaders getHeaders() { HttpHeaders headers = new HttpHeaders(); delegate.headers() .forEach(e -> headers.add(e.getKey(), e.getValue())); return headers; } VertxClientHttpResponse(HttpClientResponse delegate, Flux<DataBuffer> body); @Override int getRawStatusCode(); @Override HttpStatus getStatusCode(); @Override Flux<DataBuffer> getBody(); @Override HttpHeaders getHeaders(); @Override MultiValueMap<String, ResponseCookie> getCookies();  }