ZipkinRule implements TestRule { public InMemoryCollectorMetrics collectorMetrics() { return metrics; } ZipkinRule(); String httpUrl(); int httpRequestCount(); InMemoryCollectorMetrics collectorMetrics(); ZipkinRule storeSpans(List<Span> spans); ZipkinRule enqueueFailure(HttpFailure failure); List<List<Span>> getTraces(); @Nullable List<Span> getTrace(String traceId); List<DependencyLink> getDependencies(); void start(int httpPort); void shutdown(); @Override Statement apply(Statement base, Description description);  }
@Test public void collectorMetrics_spans() throws IOException { postSpansV1(asList(LOTS_OF_SPANS[0])); postSpansV1(asList(LOTS_OF_SPANS[1], LOTS_OF_SPANS[2])); assertThat(zipkin.collectorMetrics().spans()).isEqualTo(3); }