RequestWithHeadersServerWebExchangeAdapter implements RequestWithHeaders { @Override public Object getAttribute(String name) { return exchange.getAttribute(name); } @SuppressWarnings("ConstantConditions")  RequestWithHeadersServerWebExchangeAdapter(@NotNull ServerWebExchange exchange); @Override String getHeader(String headerName); @Override Object getAttribute(String name);  }
@Test public void getAttribute_delegates_to_ServerWebExchange() { String attributeKey = "someAttr"; Object attributeValue = UUID.randomUUID(); doReturn(attributeValue).when(exchangeMock).getAttribute(attributeKey); Object actual = adapter.getAttribute(attributeKey); assertThat(actual).isEqualTo(attributeValue); verify(exchangeMock).getAttribute(attributeKey); }