@@ -6,32 +6,32 @@ import datadog.trace.test.util.DDSpecification
66import spock.lang.Shared
77
88class ApiSecurityRequestSamplerTest extends DDSpecification {
9- def config = Mock (Config ) {
10- isApiSecurityEnabled() >> true
11- }
9+ def config = Mock (Config ) {
10+ isApiSecurityEnabled() >> true
11+ }
1212
13- def sampler = new ApiSecurityRequestSampler (config)
13+ def sampler = new ApiSecurityRequestSampler (config)
1414
15- void ' Api Security Sample Request' () {
16- when :
17- def span = Mock (IGSpanInfo ) {
18- getTags() >> [
19- " http.route" : route,
20- " http.method" : method,
21- " http.status_code" : statusCode
22- ]
23- }
24- def sample = sampler. sampleRequest(span)
15+ void ' Api Security Sample Request' () {
16+ when :
17+ def span = Mock (IGSpanInfo ) {
18+ getTags() >> [
19+ " http.route" : route,
20+ " http.method" : method,
21+ " http.status_code" : statusCode
22+ ]
23+ }
24+ def sample = sampler. sampleRequest(span)
2525
26- then :
27- sample == sampleResult
26+ then :
27+ sample == sampleResult
2828
29- where :
30- method | route | statusCode | sampleResult
31- ' GET' | ' route1' | 200 | true
32- ' GET' | ' route2' | null | false
33- ' GET' | null | 404 | false
34- ' TOP' | 999 | 404 | false
35- null | ' 999' | 404 | false
36- }
29+ where :
30+ method | route | statusCode | sampleResult
31+ ' GET' | ' route1' | 200 | true
32+ ' GET' | ' route2' | null | false
33+ ' GET' | null | 404 | false
34+ ' TOP' | 999 | 404 | false
35+ null | ' 999' | 404 | false
36+ }
3737}
0 commit comments