Search in sources :

Example 11 with AggregateCall

use of zipkin2.internal.AggregateCall in project zipkin by openzipkin.

the class CassandraSpanConsumerTest method traceByServiceSpan_indexesDurationMinimumZero.

@Test
public void traceByServiceSpan_indexesDurationMinimumZero() {
    Span span = spanWithoutAnnotationsOrTags.toBuilder().duration(12L).build();
    AggregateCall<?, Void> call = (AggregateCall<?, Void>) consumer.accept(singletonList(span));
    assertThat(call.delegate()).filteredOn(c -> c instanceof InsertTraceByServiceSpan).extracting("input.duration").containsOnly(0L);
}
Also used : AggregateCall(zipkin2.internal.AggregateCall) Span(zipkin2.Span) Test(org.junit.Test)

Example 12 with AggregateCall

use of zipkin2.internal.AggregateCall in project zipkin by openzipkin.

the class CassandraSpanConsumerTest method traceByServiceSpan_doesntIndexRemoteService.

@Test
public void traceByServiceSpan_doesntIndexRemoteService() {
    Span span = spanWithoutAnnotationsOrTags.toBuilder().remoteEndpoint(BACKEND).build();
    AggregateCall<?, Void> call = (AggregateCall<?, Void>) consumer.accept(singletonList(span));
    assertThat(call.delegate()).filteredOn(c -> c instanceof InsertTraceByServiceSpan).hasSize(2).extracting("input.service").doesNotContain(BACKEND.serviceName());
}
Also used : AggregateCall(zipkin2.internal.AggregateCall) TODAY(zipkin2.TestObjects.TODAY) Assertions.tuple(org.assertj.core.api.Assertions.tuple) AggregateCall(zipkin2.internal.AggregateCall) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Span(zipkin2.Span) Test(org.junit.Test) InsertEntry(zipkin2.storage.cassandra.internal.call.InsertEntry) Assertions.entry(org.assertj.core.api.Assertions.entry) InternalForTests.mockSession(zipkin2.storage.cassandra.InternalForTests.mockSession) Collections.singletonList(java.util.Collections.singletonList) ResultSetFutureCall(zipkin2.storage.cassandra.internal.call.ResultSetFutureCall) FRONTEND(zipkin2.TestObjects.FRONTEND) BACKEND(zipkin2.TestObjects.BACKEND) Call(zipkin2.Call) Collections(java.util.Collections) Span(zipkin2.Span) Test(org.junit.Test)

Aggregations

Span (zipkin2.Span)12 AggregateCall (zipkin2.internal.AggregateCall)12 Test (org.junit.Test)11 InsertEntry (zipkin2.storage.cassandra.internal.call.InsertEntry)4 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)2 Call (zipkin2.Call)2 Arrays.asList (java.util.Arrays.asList)1 Collections (java.util.Collections)1 Collections.singletonList (java.util.Collections.singletonList)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 IntStream (java.util.stream.IntStream)1 Assertions.entry (org.assertj.core.api.Assertions.entry)1 Assertions.tuple (org.assertj.core.api.Assertions.tuple)1 Test (org.junit.jupiter.api.Test)1 TestInfo (org.junit.jupiter.api.TestInfo)1 SERVER (zipkin2.Span.Kind.SERVER)1 BACKEND (zipkin2.TestObjects.BACKEND)1 CLIENT_SPAN (zipkin2.TestObjects.CLIENT_SPAN)1 FRONTEND (zipkin2.TestObjects.FRONTEND)1