Move SpanFactory to correct package.
RENAME
dd-trace-ot/src/test/groovy/datadog/trace/SpanFactory.groovy
dd-trace-ot/src/test/groovy/datadog/opentracing/SpanFactory.groovy
-package datadog.trace
+package datadog.opentracing
-import datadog.opentracing.DDSpan
-import datadog.opentracing.DDSpanContext
-import datadog.opentracing.DDTracer
-import datadog.opentracing.TraceCollection
import datadog.trace.common.sampling.PrioritySampling
import datadog.trace.common.writer.ListWriter
@@ -23,7 +19,7 @@ class SpanFactory {
false,
"fakeType",
Collections.emptyMap(),
- new TraceCollection(tracer),
+ new TraceCollection(tracer, 1L),
tracer)
return new DDSpan(timestampMicro, context)
}
@@ -41,11 +37,29 @@ class SpanFactory {
false,
"fakeType",
Collections.emptyMap(),
- new TraceCollection(tracer),
+ new TraceCollection(tracer, 1L),
tracer)
return new DDSpan(1, context)
}
+ static newSpanOf(TraceCollection trace) {
+ def context = new DDSpanContext(
+ trace.traceId,
+ 1L,
+ 0L,
+ "fakeService",
+ "fakeOperation",
+ "fakeResource",
+ PrioritySampling.UNSET,
+ Collections.emptyMap(),
+ false,
+ "fakeType",
+ Collections.emptyMap(),
+ trace,
+ trace.tracer)
+ return new DDSpan(1, context)
+ }
+
static DDSpan newSpanOf(String serviceName, String envName) {
def writer = new ListWriter()
def tracer = new DDTracer(writer)
@@ -61,7 +75,7 @@ class SpanFactory {
false,
"fakeType",
Collections.emptyMap(),
- new TraceCollection(tracer),
+ new TraceCollection(tracer, 1L),
tracer)
context.setTag("env", envName)
return new DDSpan(0l, context)

MODIFY
dd-trace-ot/src/test/groovy/datadog/opentracing/decorators/SpanDecoratorTest.groovy
dd-trace-ot/src/test/groovy/datadog/opentracing/decorators/SpanDecoratorTest.groovy
@@ -2,7 +2,7 @@ package datadog.opentracing.decorators
import datadog.opentracing.DDSpanContext
import datadog.opentracing.DDTracer
-import datadog.trace.SpanFactory
+import datadog.opentracing.SpanFactory
import datadog.trace.common.writer.LoggingWriter
import io.opentracing.tag.StringTag
import io.opentracing.tag.Tags

MODIFY
dd-trace-ot/src/test/groovy/datadog/trace/DDSpanContextTest.groovy
dd-trace-ot/src/test/groovy/datadog/trace/DDSpanContextTest.groovy
package datadog.trace
+import datadog.opentracing.SpanFactory
import datadog.trace.api.DDTags
import spock.lang.Specification
import spock.lang.Timeout

MODIFY
dd-trace-ot/src/test/groovy/datadog/trace/api/sampling/RateByServiceSamplerTest.groovy
dd-trace-ot/src/test/groovy/datadog/trace/api/sampling/RateByServiceSamplerTest.groovy
@@ -2,7 +2,7 @@ package datadog.trace.api.sampling
import com.fasterxml.jackson.databind.ObjectMapper
import datadog.opentracing.DDSpan
-import datadog.trace.SpanFactory
+import datadog.opentracing.SpanFactory
import datadog.trace.common.sampling.PrioritySampling
import datadog.trace.common.sampling.RateByServiceSampler
import spock.lang.Specification

MODIFY
dd-trace-ot/src/test/groovy/datadog/trace/api/writer/DDAgentWriterTest.groovy
dd-trace-ot/src/test/groovy/datadog/trace/api/writer/DDAgentWriterTest.groovy
@@ -7,7 +7,7 @@ import datadog.trace.common.writer.WriterQueue
import spock.lang.Specification
import spock.lang.Timeout
-import static datadog.trace.SpanFactory.newSpanOf
+import static datadog.opentracing.SpanFactory.newSpanOf
import static org.mockito.Mockito.mock
import static org.mockito.Mockito.verifyNoMoreInteractions

MODIFY
dd-trace-ot/src/test/groovy/datadog/trace/api/writer/DDApiTest.groovy
dd-trace-ot/src/test/groovy/datadog/trace/api/writer/DDApiTest.groovy
@@ -3,7 +3,7 @@ package datadog.trace.api.writer
import com.fasterxml.jackson.core.type.TypeReference
import com.fasterxml.jackson.databind.JsonNode
import com.fasterxml.jackson.databind.ObjectMapper
-import datadog.trace.SpanFactory
+import datadog.opentracing.SpanFactory
import datadog.trace.common.Service
import datadog.trace.common.writer.DDApi
import datadog.trace.common.writer.DDApi.ResponseListener

Move SpanFactory to correct package.