use of zipkin2.internal.AggregateCall in project zipkin by openzipkin.
the class CassandraSpanConsumerTest method serviceSpanKeys.
@Test
public void serviceSpanKeys() {
Span span = spanWithoutAnnotationsOrTags;
AggregateCall<?, Void> call = (AggregateCall<?, Void>) consumer.accept(singletonList(span));
assertThat(call.delegate()).filteredOn(c -> c instanceof InsertEntry).extracting("input").containsExactly(entry(FRONTEND.serviceName(), span.name()));
}
use of zipkin2.internal.AggregateCall in project zipkin by openzipkin.
the class ITSpanConsumer method insertEntry_niceToString.
/**
* It is easier to use a real Cassandra connection than mock a prepared statement.
*/
@Test
public void insertEntry_niceToString() {
// This test can use fake data as it is never written to cassandra
Span clientSpan = CLIENT_SPAN;
AggregateCall<?, ?> acceptCall = (AggregateCall<?, ?>) storage.spanConsumer().accept(asList(clientSpan));
List<Call<?>> insertEntryCalls = acceptCall.delegate().stream().filter(c -> c instanceof InsertEntry).collect(Collectors.toList());
assertThat(insertEntryCalls.get(0)).hasToString("INSERT INTO span_by_service (service, span) VALUES (frontend,get)");
assertThat(insertEntryCalls.get(1)).hasToString("INSERT INTO remote_service_by_service (service, remote_service) VALUES (frontend,backend)");
}
use of zipkin2.internal.AggregateCall in project zipkin by openzipkin.
the class CassandraSpanConsumerTest method traceByServiceSpan_indexesDurationInMillis.
@Test
public void traceByServiceSpan_indexesDurationInMillis() {
Span span = spanWithoutAnnotationsOrTags;
AggregateCall<?, Void> call = (AggregateCall<?, Void>) consumer.accept(singletonList(span));
assertThat(call.delegate()).filteredOn(c -> c instanceof InsertTraceByServiceSpan).extracting("input.duration").containsOnly(span.durationAsLong() / 1000L);
}
use of zipkin2.internal.AggregateCall in project zipkin by openzipkin.
the class CassandraSpanConsumerTest method doesntSetTraceIdHigh_64.
@Test
public void doesntSetTraceIdHigh_64() {
Span span = spanWithoutAnnotationsOrTags;
AggregateCall<?, Void> call = (AggregateCall<?, Void>) consumer.accept(singletonList(span));
assertThat(call.delegate()).filteredOn(c -> c instanceof InsertSpan).extracting("input.trace_id_high", "input.trace_id").containsExactly(tuple(null, span.traceId()));
}
use of zipkin2.internal.AggregateCall in project zipkin by openzipkin.
the class CassandraSpanConsumerTest method traceByServiceSpan_appendsEmptyWhenNoName.
@Test
public void traceByServiceSpan_appendsEmptyWhenNoName() {
Span span = spanWithoutAnnotationsOrTags.toBuilder().name(null).build();
AggregateCall<?, Void> call = (AggregateCall<?, Void>) consumer.accept(singletonList(span));
assertThat(call.delegate()).filteredOn(c -> c instanceof InsertTraceByServiceSpan).extracting("input.service", "input.span").containsExactly(tuple(FRONTEND.serviceName(), ""));
}
Aggregations