Skip to content

Commit 73d972e

Browse files
committed
fix test
1 parent 1ff5c57 commit 73d972e

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

dd-java-agent/agent-iast/src/test/groovy/com/datadog/iast/overhead/OverheadControllerTest.groovy

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package com.datadog.iast.overhead
22

33
import com.datadog.iast.IastRequestContext
44
import com.datadog.iast.overhead.OverheadController.OverheadControllerImpl
5+
import com.datadog.iast.taint.TaintedMap
6+
import com.datadog.iast.taint.TaintedObjects
57
import datadog.trace.api.Config
68
import datadog.trace.api.gateway.RequestContext
79
import datadog.trace.api.gateway.RequestContextSlot
@@ -376,7 +378,7 @@ class OverheadControllerTest extends DDSpecification {
376378
given:
377379
// Build a fake span + requestContext + IAST context setup
378380
OverheadContext localCtx = new OverheadContext(10, false)
379-
def iastCtx = new IastRequestContext(localCtx)
381+
def iastCtx = new IastRequestContext(TaintedObjects.build(TaintedMap.build(TaintedMap.DEFAULT_CAPACITY)), localCtx)
380382
final controller = new OverheadControllerImpl(100f, 10, true, null)
381383

382384
RequestContext rc = Stub(RequestContext) {
@@ -404,7 +406,7 @@ class OverheadControllerTest extends DDSpecification {
404406
def array = new AtomicIntegerArray(VulnerabilityTypes.STRINGS.length)
405407
array.set(VulnerabilityType.WEAK_CIPHER.type(), 2)
406408
OverheadContext.globalMap.put("PUT /skipme", array)
407-
def iastCtx = new IastRequestContext(localCtx)
409+
def iastCtx = new IastRequestContext(TaintedObjects.build(TaintedMap.build(TaintedMap.DEFAULT_CAPACITY)), localCtx)
408410
final controller = new OverheadControllerImpl(100f, 10, true, null)
409411

410412
RequestContext rc = Stub(RequestContext) {
@@ -429,7 +431,7 @@ class OverheadControllerTest extends DDSpecification {
429431
void "consumeQuota: when hasQuota true and skip=false, calls consume and returns true"() {
430432
given:
431433
OverheadContext localCtx = new OverheadContext(10, false)
432-
def iastCtx = new IastRequestContext(localCtx)
434+
def iastCtx = new IastRequestContext(TaintedObjects.build(TaintedMap.build(TaintedMap.DEFAULT_CAPACITY)), localCtx)
433435
final controller = new OverheadControllerImpl(100f, 10, true, null)
434436

435437
RequestContext rc = Stub(RequestContext) {

0 commit comments

Comments
 (0)