HttpRequestTracingUtils { public static @NotNull String getFallbackSpanNameForHttpRequest( @Nullable String prefix, @Nullable String httpMethod ) { if (StringUtils.isBlank(prefix)) { prefix = null; } if (StringUtils.isBlank(httpMethod)) { httpMethod = "UNKNOWN_HTTP_METHOD"; } return (prefix == null) ? httpMethod : prefix + "-" + httpMethod; } private  HttpRequestTracingUtils(); static Span fromRequestWithHeaders(RequestWithHeaders request, List<String> userIdHeaderKeys); static boolean hasInvalidSpanIdBecauseCallerDidNotSendOne(Span span); static boolean hasInvalidParentIdBecauseCallerDidNotSendSpanId(Span span); static String getUserIdFromRequestWithHeaders(RequestWithHeaders request, List<String> userIdHeaderKeys); static void propagateTracingHeaders(HttpObjectForPropagation httpObjectForPropagation, Span span); static String convertSampleableBooleanToExpectedB3Value(boolean sampleable); @SuppressWarnings("ConstantConditions") static @NotNull String generateSafeSpanName(
        @Nullable REQ request,
        @Nullable RES response,
        @NotNull HttpTagAndSpanNamingAdapter<REQ, RES> adapter
    ); static @NotNull String generateSafeSpanName(
        @Nullable String requestHttpMethod,
        @Nullable String pathTemplate,
        @Nullable Integer responseStatusCode
    ); static @NotNull String getFallbackSpanNameForHttpRequest(
        @Nullable String prefix,
        @Nullable String httpMethod
    ); static final String UNSPECIFIED_SPAN_NAME; static final String SPAN_FROM_HEADERS_WHERE_CALLER_DID_NOT_SEND_SPAN_ID_TAG_KEY; static final String CHILD_OF_SPAN_FROM_HEADERS_WHERE_CALLER_DID_NOT_SEND_SPAN_ID_TAG_KEY; }
@DataProvider(value = { "somePrefix | someHttpMethod | somePrefix-someHttpMethod", "somePrefix | null | somePrefix-UNKNOWN_HTTP_METHOD", "somePrefix | | somePrefix-UNKNOWN_HTTP_METHOD", "somePrefix | [whitespace] | somePrefix-UNKNOWN_HTTP_METHOD", "null | someHttpMethod | someHttpMethod", " | someHttpMethod | someHttpMethod", "[whitespace] | someHttpMethod | someHttpMethod", "null | null | UNKNOWN_HTTP_METHOD", " | | UNKNOWN_HTTP_METHOD", "[whitespace] | [whitespace] | UNKNOWN_HTTP_METHOD", }, splitBy = "\\|") @Test public void getFallbackSpanNameForHttpRequest_works_as_expected( String prefix, String httpMethod, String expectedResult ) { if ("[whitespace]".equals(prefix)) { prefix = " \n\r\t "; } if ("[whitespace]".equals(httpMethod)) { httpMethod = " \n\r\t "; } String result = HttpRequestTracingUtils.getFallbackSpanNameForHttpRequest(prefix, httpMethod); assertThat(result).isEqualTo(expectedResult); }