Search in sources :

Example 6 with StringMetaDataService

use of com.navercorp.pinpoint.profiler.metadata.StringMetaDataService in project pinpoint by naver.

the class WrappedSpanEventRecorderTest method testRecordAPIId.

@Test
public void testRecordAPIId() throws Exception {
    Span span = new Span();
    SpanEvent spanEvent = new SpanEvent(span);
    StringMetaDataService stringMetaDataService = Mockito.mock(StringMetaDataService.class);
    SqlMetaDataService sqlMetaDataService = Mockito.mock(SqlMetaDataService.class);
    WrappedSpanEventRecorder recorder = new WrappedSpanEventRecorder(stringMetaDataService, sqlMetaDataService);
    recorder.setWrapped(spanEvent);
    final int API_ID = 1000;
    recorder.recordApiId(API_ID);
    Assert.assertEquals("API ID", spanEvent.getApiId(), API_ID);
}
Also used : StringMetaDataService(com.navercorp.pinpoint.profiler.metadata.StringMetaDataService) SpanEvent(com.navercorp.pinpoint.profiler.context.SpanEvent) SqlMetaDataService(com.navercorp.pinpoint.profiler.metadata.SqlMetaDataService) Span(com.navercorp.pinpoint.profiler.context.Span) Test(org.junit.Test)

Aggregations

SqlMetaDataService (com.navercorp.pinpoint.profiler.metadata.SqlMetaDataService)6 StringMetaDataService (com.navercorp.pinpoint.profiler.metadata.StringMetaDataService)6 Test (org.junit.Test)5 Trace (com.navercorp.pinpoint.bootstrap.context.Trace)3 TraceId (com.navercorp.pinpoint.bootstrap.context.TraceId)3 Span (com.navercorp.pinpoint.profiler.context.Span)3 AsyncIdGenerator (com.navercorp.pinpoint.profiler.context.id.AsyncIdGenerator)3 DefaultTraceId (com.navercorp.pinpoint.profiler.context.id.DefaultTraceId)3 DefaultRecorderFactory (com.navercorp.pinpoint.profiler.context.recorder.DefaultRecorderFactory)3 RecorderFactory (com.navercorp.pinpoint.profiler.context.recorder.RecorderFactory)3 SpanStorage (com.navercorp.pinpoint.profiler.context.storage.SpanStorage)3 SpanEvent (com.navercorp.pinpoint.profiler.context.SpanEvent)2 SpanRecorder (com.navercorp.pinpoint.bootstrap.context.SpanRecorder)1