Search in sources :

Example 1 with MockReporter

use of co.elastic.apm.MockReporter 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 MockReporter

use of co.elastic.apm.MockReporter 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)

Aggregations

MockReporter (co.elastic.apm.MockReporter)2 ElasticApmTracer (co.elastic.apm.impl.ElasticApmTracer)2 BeforeEach (org.junit.jupiter.api.BeforeEach)2