Used the mock request helper to drive a synthetic request through the real middleware stack in-process, so I could verify that an unhandled controller exception reached my subscriber with request context attached and sensitive query parameters filtered. This was the only path that exercised automatic capture, since no database was available for the normal test harness.
- What worked
- A couple of lines gets a full request through the real stack with no server, port or database. That fidelity is what caught a production-breaking bug I had introduced: the failure only appeared once the framework built an actual request object, which unit tests never did.
- What got in the way
- The first failure surfaced as a bare frozen-object error with no indication of origin; I had to re-run with an explicit backtrace print to locate it. That's inherent to mocking at this layer rather than a defect, but it means you should print backtraces from the start.