Skip to content

Commit 07da7df

Browse files
Fix tests
1 parent bdc8d10 commit 07da7df

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

dd-java-agent/appsec/src/test/groovy/com/datadog/appsec/api/security/ApiSecurityDownstreamSamplerTest.groovy

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,22 @@ import datadog.trace.test.util.DDSpecification
55

66
class ApiSecurityDownstreamSamplerTest extends DDSpecification {
77

8-
void 'test include all/none'() {
8+
void 'test noop'() {
99
given:
1010
final ctx = Mock(AppSecRequestContext)
11-
final sampler = ApiSecurityDownstreamSampler.build(rate)
11+
final sampler = new ApiSecurityDownstreamSampler.NoOp()
1212

1313
when:
1414
final initialDecisions = (1..10).collect { sampler.sampleHttpClientRequest(ctx, it)}
1515

1616
then:
17-
initialDecisions.every { it == expected }
17+
initialDecisions.every { it == false }
1818

1919
when:
2020
final sampled = (1..10).collect { sampler.isSampled(ctx, it)}
2121

2222
then:
23-
sampled.every { it == expected }
24-
25-
where:
26-
rate | expected
27-
0D | false
28-
1D | true
23+
sampled.every { it == false }
2924
}
3025

3126
void 'test sampling algorithm'() {
@@ -45,6 +40,6 @@ class ApiSecurityDownstreamSamplerTest extends DDSpecification {
4540
rate.subtract(expectedRate).abs() <= epsilon
4641

4742
where:
48-
expectedRate << [0.1, 0.25, 0.5, 0.75, 0.9]
43+
expectedRate << [0.0, 0.1, 0.25, 0.5, 0.75, 0.9, 1.0]
4944
}
5045
}

dd-smoke-tests/appsec/springboot/src/test/groovy/datadog/smoketest/appsec/SpringBootSmokeTest.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,6 @@ class SpringBootSmokeTest extends AbstractAppSecServerSmokeTest {
410410

411411
List<String> command = new ArrayList<>()
412412
command.add(javaPath())
413-
command.add('-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005')
414413
command.addAll(defaultJavaProperties)
415414
command.addAll(defaultAppSecProperties)
416415
command.addAll((String[]) ["-jar", springBootShadowJar, "--server.port=${httpPort}"])

0 commit comments

Comments
 (0)