Skip to content

Commit

Permalink
Fix configuration exporter.
Browse files Browse the repository at this point in the history
  • Loading branch information
raphw committed Sep 28, 2023
1 parent d7887c3 commit 367bf8a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import co.elastic.apm.agent.impl.ElasticApmTracer;
import co.elastic.apm.agent.tracer.GlobalTracer;
import co.elastic.apm.agent.impl.Tracer;
import co.elastic.apm.agent.tracer.reporting.ReportingTracer;
import org.stagemonitor.configuration.ConfigurationOptionProvider;
import org.stagemonitor.configuration.ConfigurationRegistry;

Expand All @@ -38,7 +39,7 @@ public class ConfigurationExporter {

public static void main(String[] args) throws Exception {
ElasticApmTracer tracer = mock(ElasticApmTracer.class);
doReturn(tracer).when(tracer).require(ElasticApmTracer.class);
doReturn(tracer).when(tracer).require(ReportingTracer.class);
doReturn(Tracer.TracerState.UNINITIALIZED).when(tracer).getState();
GlobalTracer.init(tracer);
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import co.elastic.apm.agent.tracer.GlobalTracer;
import co.elastic.apm.agent.impl.Tracer;
import co.elastic.apm.agent.sdk.ElasticApmInstrumentation;
import co.elastic.apm.agent.tracer.reporting.ReportingTracer;
import co.elastic.apm.agent.util.DependencyInjectingServiceLoader;
import freemarker.template.Configuration;
import freemarker.template.Template;
Expand Down Expand Up @@ -88,7 +89,7 @@ class ConfigurationExporterTest {
void setUp() {
renderedDocumentationPath = Paths.get("../../docs/configuration.asciidoc");
ElasticApmTracer tracer = mock(ElasticApmTracer.class);
doReturn(tracer).when(tracer).require(ElasticApmTracer.class);
doReturn(tracer).when(tracer).require(ReportingTracer.class);
doReturn(Tracer.TracerState.UNINITIALIZED).when(tracer).getState();
GlobalTracer.init(tracer);
configurationRegistry = ConfigurationRegistry.builder()
Expand Down

0 comments on commit 367bf8a

Please sign in to comment.