Skip to content

Commit de0b7eb

Browse files
committed
Pushing a test for help debugging
Test is failing with an inexplicable ClassCastException when calling a method on initTelemetry
1 parent f44d294 commit de0b7eb

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package datadog.trace.agent
2+
3+
import datadog.trace.bootstrap.BootstrapInitializationTelemetry
4+
import datadog.trace.bootstrap.JsonBuffer
5+
import spock.lang.Specification
6+
7+
class BootstrapInitializationTelemetryTest extends Specification {
8+
def "metainfo"() {
9+
setup:
10+
def (initTelemetry, capture) = createTelemetry()
11+
12+
when:
13+
initTelemetry.finish()
14+
15+
then:
16+
capture.json() == ""
17+
}
18+
19+
static createTelemetry() {
20+
var capture = new Capture()
21+
return [
22+
new BootstrapInitializationTelemetry.JsonBased(capture),
23+
capture]
24+
}
25+
26+
static class Capture implements BootstrapInitializationTelemetry.JsonSender {
27+
JsonBuffer buffer
28+
29+
void send(JsonBuffer buffer) {
30+
this.buffer = buffer
31+
}
32+
33+
String json() {
34+
return this.buffer.toString()
35+
}
36+
}
37+
}

0 commit comments

Comments
 (0)