Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ class ExtendedDataCollectionSmokeTest extends AbstractAppSecServerSmokeTest {
}
assert trigger != null, 'test trigger not found'

rootSpan.span.metaStruct != null
!rootSpan.span.metaStruct.isEmpty()
def requestBody = rootSpan.span.metaStruct.get('http.request.body')
assert requestBody != null, 'request body is not set'
!rootSpan.meta.containsKey('_dd.appsec.request_body_size.exceeded')
Expand Down Expand Up @@ -343,7 +343,7 @@ class ExtendedDataCollectionSmokeTest extends AbstractAppSecServerSmokeTest {
}
assert trigger != null, 'test trigger not found'

rootSpan.span.metaStruct != null
!rootSpan.span.metaStruct.isEmpty()
def requestBody = rootSpan.span.metaStruct.get('http.request.body')
assert requestBody != null, 'request body is not set'
!rootSpan.meta.containsKey('_dd.appsec.request_body_size.exceeded')
Expand Down Expand Up @@ -383,7 +383,7 @@ class ExtendedDataCollectionSmokeTest extends AbstractAppSecServerSmokeTest {
}
assert trigger != null, 'test trigger not found'

rootSpan.span.metaStruct != null
!rootSpan.span.metaStruct.isEmpty()
def requestBody = rootSpan.span.metaStruct.get('http.request.body')
assert requestBody != null, 'request body is not set'
rootSpan.meta.containsKey('_dd.appsec.request_body_size.exceeded')
Expand Down Expand Up @@ -421,7 +421,7 @@ class ExtendedDataCollectionSmokeTest extends AbstractAppSecServerSmokeTest {
}
assert trigger == null, 'test trigger found'

rootSpan.span.metaStruct == null
rootSpan.span.metaStruct.isEmpty()
}

void 'test request body collection if WAF event with default-config'(){
Expand Down Expand Up @@ -457,7 +457,7 @@ class ExtendedDataCollectionSmokeTest extends AbstractAppSecServerSmokeTest {
}
assert trigger != null, 'test trigger not found'

rootSpan.span.metaStruct != null
!rootSpan.span.metaStruct.isEmpty()
def requestBody = rootSpan.span.metaStruct.get('http.request.body')
assert requestBody != null, 'request body is not set'
!rootSpan.meta.containsKey('_dd.appsec.request_body_size.exceeded')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ class SpringBootSmokeTest extends AbstractAppSecServerSmokeTest {
}
}
assert trigger != null, 'test trigger not found'
rootSpan.span.metaStruct != null
!rootSpan.span.metaStruct.isEmpty()
def stack = rootSpan.span.metaStruct.get('_dd.stack')
assert stack != null, 'stack is not set'
def exploit = stack.get('exploit')
Expand Down Expand Up @@ -774,7 +774,7 @@ class SpringBootSmokeTest extends AbstractAppSecServerSmokeTest {
}
}
assert trigger != null, 'test trigger not found'
rootSpan.span.metaStruct == null
rootSpan.span.metaStruct.isEmpty()

where:
variant | _
Expand Down Expand Up @@ -814,7 +814,7 @@ class SpringBootSmokeTest extends AbstractAppSecServerSmokeTest {
}
}
assert trigger != null, 'test trigger not found'
rootSpan.span.metaStruct == null
rootSpan.span.metaStruct.isEmpty()

where:
variant | _
Expand Down Expand Up @@ -853,7 +853,7 @@ class SpringBootSmokeTest extends AbstractAppSecServerSmokeTest {
}
}
assert trigger != null, 'test trigger not found'
rootSpan.span.metaStruct == null
rootSpan.span.metaStruct.isEmpty()
}

def findFirstMatchingSpan(String resource) {
Expand Down Expand Up @@ -939,7 +939,7 @@ class SpringBootSmokeTest extends AbstractAppSecServerSmokeTest {
}
}
assert trigger != null, 'test trigger not found'
rootSpan.span.metaStruct == null
rootSpan.span.metaStruct.isEmpty()

where:
endpoint | cmd | params
Expand Down Expand Up @@ -990,7 +990,7 @@ class SpringBootSmokeTest extends AbstractAppSecServerSmokeTest {
}
}
assert trigger != null, 'test trigger not found'
rootSpan.span.metaStruct == null
rootSpan.span.metaStruct.isEmpty()

where:
endpoint | cmd | params
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package datadog.trace.test.agent.decoder.v04.raw;

import static java.util.Collections.emptyMap;
import static java.util.Collections.unmodifiableMap;

import datadog.trace.test.agent.decoder.DecodedSpan;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -265,9 +267,9 @@ public SpanV04(
this.start = start;
this.duration = duration;
this.error = error;
this.meta = Collections.unmodifiableMap(meta);
this.metaStruct = metaStruct == null ? null : Collections.unmodifiableMap(metaStruct);
this.metrics = Collections.unmodifiableMap(metrics);
this.meta = unmodifiableMap(meta);
this.metaStruct = metaStruct == null ? emptyMap() : unmodifiableMap(metaStruct);
this.metrics = unmodifiableMap(metrics);
this.type = type;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package datadog.trace.test.agent.decoder.v05.raw;

import static java.util.Collections.emptyMap;

import datadog.trace.test.agent.decoder.DecodedSpan;
import java.io.IOException;
import java.util.Collections;
Expand Down Expand Up @@ -190,7 +192,7 @@ public Map<String, String> getMeta() {

public Map<String, Object> getMetaStruct() {
// XXX: meta_struct is not supported in v0.5.
return null;
return emptyMap();
}

public Map<String, Number> getMetrics() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package datadog.trace.test.agent.decoder.v1.raw;

import static java.util.Collections.emptyMap;
import static java.util.Collections.unmodifiableMap;

import datadog.trace.test.agent.decoder.DecodedSpan;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -492,9 +494,9 @@ public SpanV1(
this.start = start;
this.duration = duration;
this.error = error;
this.meta = Collections.unmodifiableMap(meta);
this.metaStruct = metaStruct == null ? null : Collections.unmodifiableMap(metaStruct);
this.metrics = Collections.unmodifiableMap(metrics);
this.meta = unmodifiableMap(meta);
this.metaStruct = metaStruct == null ? emptyMap() : unmodifiableMap(metaStruct);
this.metrics = unmodifiableMap(metrics);
this.type = type;
}

Expand Down