ZipkinRule implements TestRule { public List<List<Span>> getTraces() { return storage.spanStore().getTraces(); } 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 getTraces_storedViaPost() throws IOException { List<Span> trace = asList(CLIENT_SPAN); assertThat(postSpansV1(trace).code()).isEqualTo(202); assertThat(zipkin.getTraces()).containsOnly(trace); }
@Test public void getTraces_whenMissingTimestamps() throws IOException { Span span = Span.newBuilder().traceId("1").id("1").name("foo").build(); assertThat(postSpansV1(asList(span)).code()).isEqualTo(202); assertThat(zipkin.getTraces()).containsOnly(asList(span)); }