RequestWithHeadersServerWebExchangeAdapter implements RequestWithHeaders { @Override public String getHeader(String headerName) { return exchange.getRequest().getHeaders().getFirst(headerName); } @SuppressWarnings("ConstantConditions")  RequestWithHeadersServerWebExchangeAdapter(@NotNull ServerWebExchange exchange); @Override String getHeader(String headerName); @Override Object getAttribute(String name);  }
@Test public void getHeader_delegates_to_request_headers_getFirst() { String headerName = "someHeader"; String headerValue = UUID.randomUUID().toString(); doReturn(headerValue).when(headersMock).getFirst(headerName); String actual = adapter.getHeader(headerName); assertThat(actual).isEqualTo(headerValue); verify(headersMock).getFirst(headerName); }