Skip to content

Add unit tests for src/backend/processor/response.go #429

@hanneshapke

Description

@hanneshapke

src/backend/processor/response.go is the only file in the processor package and has no response_test.go. Response post-processing (PII restoration / streaming handling) is on the hot path and worth testing in isolation.

What to add

Create src/backend/processor/response_test.go with table-driven tests for:

  • Non-streaming JSON response — masked values are restored to originals
  • Streaming/SSE response — chunks are reassembled and restored correctly
  • Empty body / no PII — passes through unchanged
  • Mapping miss (response contains a masked token with no entry in the map) — fallback is documented and tested

Hints

  • Mirror the style of src/backend/pii/database_test.go for table-driven tests.
  • Construct mappings manually rather than wiring up the full detector.
  • Run go test ./src/backend/processor/....

Difficulty: good first issue, ~1–2 hours.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions