use of zipkin2.storage.cassandra.internal.call.InsertEntry in project zipkin by openzipkin.
the class CassandraSpanConsumerTest method serviceRemoteServiceKeys_addsRemoteServiceName.
@Test
public void serviceRemoteServiceKeys_addsRemoteServiceName() {
Span span = spanWithoutAnnotationsOrTags.toBuilder().remoteEndpoint(BACKEND).build();
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()), entry(FRONTEND.serviceName(), BACKEND.serviceName()));
}
use of zipkin2.storage.cassandra.internal.call.InsertEntry 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.storage.cassandra.internal.call.InsertEntry 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)");
}
Aggregations