Skip to content

Commit

Permalink
Fix test for derivatives set in the span
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-alvarez-alvarez committed Aug 28, 2024
1 parent d9aa4f1 commit 611b9e8
Showing 1 changed file with 3 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -925,31 +925,19 @@ class GatewayBridgeSpecification extends DDSpecification {
'appsec.another.unrelated.tag' | false
}

void 'derivatives are set in the span after a request'() {
void 'fingerprints are set in the span after a request'() {
given:
final mockAppSecCtx = Stub(AppSecRequestContext) {
transferCollectedEvents() >> []
getRequestHeaders() >> [
'host': ['localhost']
]
}
final mockAppSecCtx = new AppSecRequestContext(derivatives: ['_dd.appsec.fp.http.endpoint': 'xyz'])
final mockCtx = Stub(RequestContext) {
getData(RequestContextSlot.APPSEC) >> mockAppSecCtx
getTraceSegment() >> traceSegment
}
final spanInfo = Stub(AgentSpan)
traceSegment.getTagTop(tag) >> true

when:
requestEndedCB.apply(mockCtx, spanInfo)

then:
(userTracking ? 1 : 0) * traceSegment.setTagTop('http.request.headers.host', 'localhost')

where:
tag | userTracking
'appsec.events.users.login.success.track' | true
'appsec.events.users.login.failure.track' | true
'appsec.another.unrelated.tag' | false
1 * traceSegment.setTagTop('_dd.appsec.fp.http.endpoint', 'xyz')
}
}

0 comments on commit 611b9e8

Please sign in to comment.