1# jev-mock
2
3A mock TypeSafe System One endpoint for tests: HTTP/2 over TLS on
4loopback, a throwaway CA (`ca_file()`), every request recorded, answers
5from a closure (`Reply`). It knows nothing about Postgres, so any Jev
6client can test against it.
7
8`replay::Replay` answers from a recorded fixture instead, keyed by the
9exact request bytes (`replay::Fixture`, one JSON file of request and
10response lists). A request the fixture lacks is answered with a 400 that
11names it, and `assert_complete` (also run on drop) fails the test.
12
13`forward::Forward` produces those fixtures: it passes each request to a
14real endpoint with the API key and records the answer (`fixture()`). It
15needs a multi-threaded tokio runtime. `exchange(body)` sends and records a
16request built elsewhere, without the mock. `tools/record-gates --send` uses
17both.