Skip to main content

Module context

Module context 

Source
Expand description

Deterministic RequestContext builders for tests.

RequestContext::new mints a random request id and stamps the arrival time from the system clock, so two contexts are never equal and timestamps drift run-to-run. These helpers produce a context with a fixed, seeded request id and a pinned received_at, giving reproducible fixtures while still letting you set the fields a test cares about (tenant, locale, …).

Structs§

TestContextBuilder
Builds a deterministic RequestContext for tests.

Functions§

test_context
A deterministic RequestContext with a seeded request id and a pinned received_at.