Search in sources :

Example 1 with TRACE

use of zipkin.TestObjects.TRACE in project zipkin by openzipkin.

the class InternalGuavaSpanStoreAdapterTest method getTraces_success.

@Test
public void getTraces_success() throws Exception {
    QueryRequest request = QueryRequest.builder().build();
    doAnswer(answer(c -> c.onSuccess(asList(TRACE)))).when(asyncSpanStore).getTraces(eq(request), any(Callback.class));
    assertThat(spanStore.getTraces(request).get()).containsExactly(TRACE);
}
Also used : TRACE(zipkin.TestObjects.TRACE) Mock(org.mockito.Mock) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Test(org.junit.Test) LINKS(zipkin.TestObjects.LINKS) AsyncSpanStore(zipkin.storage.AsyncSpanStore) ExecutionException(java.util.concurrent.ExecutionException) Consumer(java.util.function.Consumer) Matchers.any(org.mockito.Matchers.any) Answer(org.mockito.stubbing.Answer) Is.isA(org.hamcrest.core.Is.isA) Rule(org.junit.Rule) Arrays.asList(java.util.Arrays.asList) Matchers.eq(org.mockito.Matchers.eq) Mockito.doAnswer(org.mockito.Mockito.doAnswer) QueryRequest(zipkin.storage.QueryRequest) MockitoJUnit(org.mockito.junit.MockitoJUnit) MockitoRule(org.mockito.junit.MockitoRule) ExpectedException(org.junit.rules.ExpectedException) Callback(zipkin.storage.Callback) Before(org.junit.Before) Callback(zipkin.storage.Callback) QueryRequest(zipkin.storage.QueryRequest) Test(org.junit.Test)

Aggregations

Arrays.asList (java.util.Arrays.asList)1 ExecutionException (java.util.concurrent.ExecutionException)1 Consumer (java.util.function.Consumer)1 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)1 Is.isA (org.hamcrest.core.Is.isA)1 Before (org.junit.Before)1 Rule (org.junit.Rule)1 Test (org.junit.Test)1 ExpectedException (org.junit.rules.ExpectedException)1 Matchers.any (org.mockito.Matchers.any)1 Matchers.eq (org.mockito.Matchers.eq)1 Mock (org.mockito.Mock)1 Mockito.doAnswer (org.mockito.Mockito.doAnswer)1 MockitoJUnit (org.mockito.junit.MockitoJUnit)1 MockitoRule (org.mockito.junit.MockitoRule)1 Answer (org.mockito.stubbing.Answer)1 LINKS (zipkin.TestObjects.LINKS)1 TRACE (zipkin.TestObjects.TRACE)1 AsyncSpanStore (zipkin.storage.AsyncSpanStore)1 Callback (zipkin.storage.Callback)1