@Test public void translate_missingName() { Span zipkinSpan = Span.newBuilder().traceId("3").id("2").build(); com.google.devtools.cloudtrace.v2.Span translated = SpanTranslator.translate( com.google.devtools.cloudtrace.v2.Span.newBuilder(), zipkinSpan).build(); assertThat(translated.getDisplayName().getValue()).isNotEmpty(); }
public static List<com.google.devtools.cloudtrace.v2.Span> translate( String projectId, List<Span> zipkinSpans) { List<com.google.devtools.cloudtrace.v2.Span> result = new ArrayList<>(zipkinSpans.size()); for (int i = 0, len = zipkinSpans.size(); i < len; i++) { Span zipkinSpan = zipkinSpans.get(i); com.google.devtools.cloudtrace.v2.Span.Builder spanBuilder = translate( com.google.devtools.cloudtrace.v2.Span.newBuilder(), zipkinSpan); spanBuilder.setName( "projects/" + projectId + "/traces/" + paddedTraceId(zipkinSpan.traceId()) + "/spans/" + zipkinSpan.id()); result.add(spanBuilder.build()); } return result; }
SpanTranslator { public static List<com.google.devtools.cloudtrace.v2.Span> translate( String projectId, List<Span> zipkinSpans) { List<com.google.devtools.cloudtrace.v2.Span> result = new ArrayList<>(zipkinSpans.size()); for (int i = 0, len = zipkinSpans.size(); i < len; i++) { Span zipkinSpan = zipkinSpans.get(i); com.google.devtools.cloudtrace.v2.Span.Builder spanBuilder = translate( com.google.devtools.cloudtrace.v2.Span.newBuilder(), zipkinSpan); spanBuilder.setName( "projects/" + projectId + "/traces/" + paddedTraceId(zipkinSpan.traceId()) + "/spans/" + zipkinSpan.id()); result.add(spanBuilder.build()); } return result; } }
SpanTranslator { public static List<com.google.devtools.cloudtrace.v2.Span> translate( String projectId, List<Span> zipkinSpans) { List<com.google.devtools.cloudtrace.v2.Span> result = new ArrayList<>(zipkinSpans.size()); for (int i = 0, len = zipkinSpans.size(); i < len; i++) { Span zipkinSpan = zipkinSpans.get(i); com.google.devtools.cloudtrace.v2.Span.Builder spanBuilder = translate( com.google.devtools.cloudtrace.v2.Span.newBuilder(), zipkinSpan); spanBuilder.setName( "projects/" + projectId + "/traces/" + paddedTraceId(zipkinSpan.traceId()) + "/spans/" + zipkinSpan.id()); result.add(spanBuilder.build()); } return result; }  }
SpanTranslator { public static List<com.google.devtools.cloudtrace.v2.Span> translate( String projectId, List<Span> zipkinSpans) { List<com.google.devtools.cloudtrace.v2.Span> result = new ArrayList<>(zipkinSpans.size()); for (int i = 0, len = zipkinSpans.size(); i < len; i++) { Span zipkinSpan = zipkinSpans.get(i); com.google.devtools.cloudtrace.v2.Span.Builder spanBuilder = translate( com.google.devtools.cloudtrace.v2.Span.newBuilder(), zipkinSpan); spanBuilder.setName( "projects/" + projectId + "/traces/" + paddedTraceId(zipkinSpan.traceId()) + "/spans/" + zipkinSpan.id()); result.add(spanBuilder.build()); } return result; }  static List<com.google.devtools.cloudtrace.v2.Span> translate(
      String projectId, List<Span> zipkinSpans); static com.google.devtools.cloudtrace.v2.Span.Builder translate(
      com.google.devtools.cloudtrace.v2.Span.Builder spanBuilder,
      Span zipkinSpan); }
SpanTranslator { public static List<com.google.devtools.cloudtrace.v2.Span> translate( String projectId, List<Span> zipkinSpans) { List<com.google.devtools.cloudtrace.v2.Span> result = new ArrayList<>(zipkinSpans.size()); for (int i = 0, len = zipkinSpans.size(); i < len; i++) { Span zipkinSpan = zipkinSpans.get(i); com.google.devtools.cloudtrace.v2.Span.Builder spanBuilder = translate( com.google.devtools.cloudtrace.v2.Span.newBuilder(), zipkinSpan); spanBuilder.setName( "projects/" + projectId + "/traces/" + paddedTraceId(zipkinSpan.traceId()) + "/spans/" + zipkinSpan.id()); result.add(spanBuilder.build()); } return result; }  static List<com.google.devtools.cloudtrace.v2.Span> translate(
      String projectId, List<Span> zipkinSpans); static com.google.devtools.cloudtrace.v2.Span.Builder translate(
      com.google.devtools.cloudtrace.v2.Span.Builder spanBuilder,
      Span zipkinSpan);  }