pub struct AppState {
pub overrides: Arc<Mutex<Overrides>>,
pub received_events: Arc<Mutex<Vec<Value>>>,
pub received_executes: Arc<Mutex<Vec<CapturedPost>>>,
pub received_auto_toggles: Arc<Mutex<Vec<CapturedPost>>>,
pub received_live_controls: Arc<Mutex<Vec<String>>>,
}Expand description
Shared state for the mock axum app.
Fields§
§overrides: Arc<Mutex<Overrides>>§received_events: Arc<Mutex<Vec<Value>>>Every body the mock has received on POST /operator/events,
captured as the raw decoded JSON in arrival order. Tests that
exercise the /rate, /break, etc. rewires assert on this
to confirm the typed-event serialization actually reached the
wire. Kept as serde_json::Value rather than the typed
zero_operator_state::Event so the mock does not pre-validate
— the engine’s real behavior (400 on bad shapes) is already
covered by the Python-side integration test.
received_executes: Arc<Mutex<Vec<CapturedPost>>>Every (headers-snapshot, body) pair the mock has received on
POST /execute, in arrival order. Tests assert on the headers
(especially x-zero-mode and x-idempotency-key) and the
body shape (typed ExecuteRequest round-trip via serde_json).
Captured as (BTreeMap<String, String>, Value) so both the
test and the stored data are trivially cloneable / printable
when an assertion fails.
received_auto_toggles: Arc<Mutex<Vec<CapturedPost>>>Every (headers-snapshot, body) pair the mock has received on
POST /auto/toggle. Same shape as Self::received_executes.
received_live_controls: Arc<Mutex<Vec<String>>>Every live control endpoint path the mock has received, in order.