@Test public void putTagIfValueIsNotBlank_calls_span_putTag_as_expected_for_tagValue_toString_when_result_is_not_blank() { Object tagValueMock = mock(Object.class); String tagValueToStringResult = "tag_value-" + UUID.randomUUID().toString(); doReturn(tagValueToStringResult).when(tagValueMock).toString(); String tagKey = "tag_key-" + UUID.randomUUID().toString(); implSpy.putTagIfValueIsNotBlank(spanMock, tagKey, tagValueMock); verify(spanMock).putTag(tagKey, tagValueToStringResult); }
protected void putTagIfValueIsNotBlank( @NotNull Span span, @NotNull String tagKey, @Nullable Object tagValue ) { if (tagValue == null || span == null || tagKey == null) { return; } String tagValueString = tagValue.toString(); if (StringUtils.isBlank(tagValueString)) { return; } span.putTag(tagKey, tagValueString); }
HttpTagAndSpanNamingStrategy { protected void putTagIfValueIsNotBlank( @NotNull Span span, @NotNull String tagKey, @Nullable Object tagValue ) { if (tagValue == null || span == null || tagKey == null) { return; } String tagValueString = tagValue.toString(); if (StringUtils.isBlank(tagValueString)) { return; } span.putTag(tagKey, tagValueString); } }
HttpTagAndSpanNamingStrategy { protected void putTagIfValueIsNotBlank( @NotNull Span span, @NotNull String tagKey, @Nullable Object tagValue ) { if (tagValue == null || span == null || tagKey == null) { return; } String tagValueString = tagValue.toString(); if (StringUtils.isBlank(tagValueString)) { return; } span.putTag(tagKey, tagValueString); }  }
HttpTagAndSpanNamingStrategy { protected void putTagIfValueIsNotBlank( @NotNull Span span, @NotNull String tagKey, @Nullable Object tagValue ) { if (tagValue == null || span == null || tagKey == null) { return; } String tagValueString = tagValue.toString(); if (StringUtils.isBlank(tagValueString)) { return; } span.putTag(tagKey, tagValueString); }  final @Nullable String getInitialSpanName(
        @NotNull REQ request,
        @NotNull HttpTagAndSpanNamingAdapter<REQ, ?> adapter
    ); final void handleRequestTagging(
        @NotNull Span span,
        @NotNull REQ request,
        @NotNull HttpTagAndSpanNamingAdapter<REQ, ?> adapter
    ); final void handleResponseTaggingAndFinalSpanName(
        @NotNull Span span,
        @Nullable REQ request,
        @Nullable RES response,
        @Nullable Throwable error,
        @NotNull HttpTagAndSpanNamingAdapter<REQ, RES> adapter
    ); }
HttpTagAndSpanNamingStrategy { protected void putTagIfValueIsNotBlank( @NotNull Span span, @NotNull String tagKey, @Nullable Object tagValue ) { if (tagValue == null || span == null || tagKey == null) { return; } String tagValueString = tagValue.toString(); if (StringUtils.isBlank(tagValueString)) { return; } span.putTag(tagKey, tagValueString); }  final @Nullable String getInitialSpanName(
        @NotNull REQ request,
        @NotNull HttpTagAndSpanNamingAdapter<REQ, ?> adapter
    ); final void handleRequestTagging(
        @NotNull Span span,
        @NotNull REQ request,
        @NotNull HttpTagAndSpanNamingAdapter<REQ, ?> adapter
    ); final void handleResponseTaggingAndFinalSpanName(
        @NotNull Span span,
        @Nullable REQ request,
        @Nullable RES response,
        @Nullable Throwable error,
        @NotNull HttpTagAndSpanNamingAdapter<REQ, RES> adapter
    );  }