fakeMiddleware is a minimal Middleware for chain composition tests. It records the metadata the dispatcher hands to it and emits a caller-supplied Output. Tests use the recorded snapshot to assert that earlier-in-slot emissions are visible to later middlewares.
| 14 | // caller-supplied Output. Tests use the recorded snapshot to assert |
| 15 | // that earlier-in-slot emissions are visible to later middlewares. |
| 16 | type fakeMiddleware struct { |
| 17 | id string |
| 18 | slot Slot |
| 19 | keys []string |
| 20 | emit []KV |
| 21 | decision Decision |
| 22 | mutationsSupported bool |
| 23 | canMutate bool |
| 24 | mutations *Mutations |
| 25 | |
| 26 | // seen captures the in.Metadata snapshot the dispatcher passed to |
| 27 | // Invoke, so tests can assert ordering and visibility. |
| 28 | seen []KV |
| 29 | } |
| 30 | |
| 31 | func (f *fakeMiddleware) ID() string { return f.id } |
| 32 | func (f *fakeMiddleware) Version() string { return "test" } |
nothing calls this directly
no outgoing calls
no test coverage detected