Search in sources :

Example 1 with ElasticApmTracer

use of co.elastic.apm.impl.ElasticApmTracer in project apm-agent-java by elastic.

the class ApmJdbcEventListenerTest method setUp.

@BeforeEach
void setUp() throws SQLException {
    ElasticApmTracer tracer = ElasticApmTracer.builder().configurationRegistry(SpyConfiguration.createSpyConfig()).reporter(new MockReporter()).build().register();
    connection = DriverManager.getConnection("jdbc:p6spy:h2:mem:test", "user", "");
    connection.createStatement().execute("CREATE TABLE IF NOT EXISTS ELASTIC_APM (FOO INT, BAR VARCHAR(255))");
    connection.createStatement().execute("INSERT INTO ELASTIC_APM (FOO, BAR) VALUES (1, 'APM')");
    transaction = tracer.startTransaction();
}
Also used : MockReporter(co.elastic.apm.MockReporter) ElasticApmTracer(co.elastic.apm.impl.ElasticApmTracer) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with ElasticApmTracer

use of co.elastic.apm.impl.ElasticApmTracer in project apm-agent-java by elastic.

the class ApmFilterTest method setUp.

@BeforeEach
void setUp() {
    reporter = new MockReporter();
    config = SpyConfiguration.createSpyConfig();
    ElasticApmTracer tracer = ElasticApmTracer.builder().configurationRegistry(config).reporter(reporter).build();
    apmFilter = new ApmFilter(tracer);
}
Also used : MockReporter(co.elastic.apm.MockReporter) ElasticApmTracer(co.elastic.apm.impl.ElasticApmTracer) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 3 with ElasticApmTracer

use of co.elastic.apm.impl.ElasticApmTracer in project apm-agent-java by elastic.

the class ApmHandlerInterceptorTest method setup.

@BeforeEach
void setup() {
    final ElasticApmTracer tracer = ElasticApmTracer.builder().configurationRegistry(SpyConfiguration.createSpyConfig()).build();
    this.mockMvc = MockMvcBuilders.standaloneSetup(new TestController(tracer)).addFilters(new ApmFilter(tracer)).addInterceptors(new ApmHandlerInterceptor(tracer)).build();
}
Also used : ElasticApmTracer(co.elastic.apm.impl.ElasticApmTracer) ApmFilter(co.elastic.apm.servlet.ApmFilter) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

ElasticApmTracer (co.elastic.apm.impl.ElasticApmTracer)3 BeforeEach (org.junit.jupiter.api.BeforeEach)3 MockReporter (co.elastic.apm.MockReporter)2 ApmFilter (co.elastic.apm.servlet.ApmFilter)1