@Test public void accept_empty() throws Exception { spanConsumer.accept(Collections.emptyList()).execute(); verify(traceService, never()).batchWriteSpans(any(), any()); }
@Override public Call<Void> accept(List<Span> spans) { if (spans.isEmpty()) return Call.create(null); List<com.google.devtools.cloudtrace.v2.Span> stackdriverSpans = SpanTranslator.translate(projectId, spans); BatchWriteSpansRequest request = BatchWriteSpansRequest.newBuilder() .setName(projectName) .addAllSpans(stackdriverSpans) .build(); return new BatchWriteSpansCall(grpcClient, request); }
StackdriverSpanConsumer implements SpanConsumer { @Override public Call<Void> accept(List<Span> spans) { if (spans.isEmpty()) return Call.create(null); List<com.google.devtools.cloudtrace.v2.Span> stackdriverSpans = SpanTranslator.translate(projectId, spans); BatchWriteSpansRequest request = BatchWriteSpansRequest.newBuilder() .setName(projectName) .addAllSpans(stackdriverSpans) .build(); return new BatchWriteSpansCall(grpcClient, request); } }
StackdriverSpanConsumer implements SpanConsumer { @Override public Call<Void> accept(List<Span> spans) { if (spans.isEmpty()) return Call.create(null); List<com.google.devtools.cloudtrace.v2.Span> stackdriverSpans = SpanTranslator.translate(projectId, spans); BatchWriteSpansRequest request = BatchWriteSpansRequest.newBuilder() .setName(projectName) .addAllSpans(stackdriverSpans) .build(); return new BatchWriteSpansCall(grpcClient, request); } StackdriverSpanConsumer(UnaryGrpcClient grpcClient, String projectId); }
StackdriverSpanConsumer implements SpanConsumer { @Override public Call<Void> accept(List<Span> spans) { if (spans.isEmpty()) return Call.create(null); List<com.google.devtools.cloudtrace.v2.Span> stackdriverSpans = SpanTranslator.translate(projectId, spans); BatchWriteSpansRequest request = BatchWriteSpansRequest.newBuilder() .setName(projectName) .addAllSpans(stackdriverSpans) .build(); return new BatchWriteSpansCall(grpcClient, request); } StackdriverSpanConsumer(UnaryGrpcClient grpcClient, String projectId); @Override Call<Void> accept(List<Span> spans); }
StackdriverSpanConsumer implements SpanConsumer { @Override public Call<Void> accept(List<Span> spans) { if (spans.isEmpty()) return Call.create(null); List<com.google.devtools.cloudtrace.v2.Span> stackdriverSpans = SpanTranslator.translate(projectId, spans); BatchWriteSpansRequest request = BatchWriteSpansRequest.newBuilder() .setName(projectName) .addAllSpans(stackdriverSpans) .build(); return new BatchWriteSpansCall(grpcClient, request); } StackdriverSpanConsumer(UnaryGrpcClient grpcClient, String projectId); @Override Call<Void> accept(List<Span> spans);  }