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 742e76e commit 3ea33c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 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 @@ -90,8 +90,7 @@ class ConfigurationExporterTest {
void setUp() {
renderedDocumentationPath = Paths.get("../../docs/configuration.asciidoc");
ElasticApmTracer tracer = mock(ElasticApmTracer.class);
when(tracer.require(ReportingTracer.class)).thenReturn(tracer);
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 3ea33c8

Please sign in to comment.