Skip to content

Commit c65045d

Browse files
committed
Add more tests
1 parent 7c36871 commit c65045d

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

internal-api/src/test/groovy/datadog/trace/api/MethodFilterConfigParserTest.groovy

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,27 @@ class MethodFilterConfigParserTest extends DDSpecification {
4646
"asdfg;c1[m1]" | [:]
4747
}
4848

49+
def "test native method configuration \"#value\""() {
50+
setup:
51+
if (value) {
52+
injectSysConfig("dd.trace.native.methods", value)
53+
} else {
54+
removeSysConfig("dd.trace.methods")
55+
}
56+
57+
expect:
58+
InstrumenterConfig.get().traceNativeMethods == expected
59+
60+
where:
61+
value | expected
62+
null | [:]
63+
" " | [:]
64+
"*" | [:]
65+
"[ method , ]" | ["": ["method"].toSet()]
66+
"lib[ method1 , method2]" | ["lib": ["method1", "method2"].toSet()]
67+
"[*]" | ["": ["*"].toSet()]
68+
}
69+
4970
def "survive very long list"() {
5071
setup:
5172
def mset = ["m1", "m2"].toSet()

0 commit comments

Comments
 (0)