WingtipsToZipkinSpanConverterDefaultImpl implements WingtipsToZipkinSpanConverter { protected zipkin2.Span.Kind determineZipkinKind(Span wingtipsSpan) { SpanPurpose wtsp = wingtipsSpan.getSpanPurpose(); if (SpanPurpose.SERVER == wtsp) { return zipkin2.Span.Kind.SERVER; } else if (SpanPurpose.CLIENT == wtsp) { return zipkin2.Span.Kind.CLIENT; } else if (SpanPurpose.LOCAL_ONLY == wtsp || SpanPurpose.UNKNOWN == wtsp) { return null; } else { logger.warn("Unhandled SpanPurpose type: {}", wtsp); return null; } } WingtipsToZipkinSpanConverterDefaultImpl();  WingtipsToZipkinSpanConverterDefaultImpl(boolean enableIdSanitization); @Override zipkin2.Span convertWingtipsSpanToZipkinSpan(Span wingtipsSpan, Endpoint zipkinEndpoint);  }
@DataProvider(value = { "SERVER", "CLIENT", "LOCAL_ONLY", "UNKNOWN", "NULL" }) @Test public void determineZipkinKind_returns_expected_Zipkin_Kind_for_wingtips_SpanPurpose( WingtipsSpanPurposeToZipkinKindScenario scenario ) { Span wingtipsSpan = Span.newBuilder("foo", scenario.wingtipsSpanPurpose).build(); if (scenario.wingtipsSpanPurpose == null) { Whitebox.setInternalState(wingtipsSpan, "spanPurpose", null); } zipkin2.Span.Kind result = impl.determineZipkinKind(wingtipsSpan); assertThat(result).isEqualTo(scenario.expectedZipkinKind); }