SpringWebfluxServerRequestTagAdapter extends HttpTagAndSpanNamingAdapter<ServerWebExchange, ServerHttpResponse> { @Override public @Nullable String getHeaderSingleValue(@Nullable ServerWebExchange exchange, @NotNull String headerKey) { if (exchange == null || exchange.getRequest() == null) { return null; } return exchange.getRequest().getHeaders().getFirst(headerKey); }  static SpringWebfluxServerRequestTagAdapter getDefaultInstance(); @Override @Nullable String getErrorResponseTagValue(@Nullable ServerHttpResponse response); @Override @Nullable String getRequestUrl(@Nullable ServerWebExchange exchange); @Override @Nullable Integer getResponseHttpStatus(@Nullable ServerHttpResponse response); @Override @Nullable String getRequestHttpMethod(@Nullable ServerWebExchange exchange); @Override @Nullable String getRequestPath(@Nullable ServerWebExchange exchange); @Override @Nullable String getRequestUriPathTemplate(
        @Nullable ServerWebExchange exchange,
        @Nullable ServerHttpResponse response
    ); @Override @Nullable String getHeaderSingleValue(@Nullable ServerWebExchange exchange, @NotNull String headerKey); @Override @Nullable List<String> getHeaderMultipleValue(
        @Nullable ServerWebExchange exchange, @NotNull String headerKey
    ); @Override @Nullable String getSpanHandlerTagValue(
        @Nullable ServerWebExchange exchange, @Nullable ServerHttpResponse response
    );  }
@Test public void getHeaderSingleValue_works_as_expected() { String headerKey = UUID.randomUUID().toString(); String expectedResult = UUID.randomUUID().toString(); doReturn(expectedResult).when(headersMock).getFirst(anyString()); String result = adapterSpy.getHeaderSingleValue(exchangeMock, headerKey); assertThat(result).isEqualTo(expectedResult); verify(headersMock).getFirst(headerKey); }
@Test public void getHeaderSingleValue_returns_null_when_passed_null_exchange() { assertThat(adapterSpy.getHeaderSingleValue(null, "foo")).isNull(); }
@Test public void getHeaderSingleValue_returns_null_when_exchange_request_is_null() { doReturn(null).when(exchangeMock).getRequest(); assertThat(adapterSpy.getHeaderSingleValue(exchangeMock, "foo")).isNull(); }