bifrostMockResponder top-level property
The responder every mocked request consults, read per request.
Assign it directly to change behaviour mid-test:
bifrostMockResponder = (request) async => http.Response('[]', 503);
Reading it per request, rather than capturing it when the client is built,
is what makes it swappable after something has already taken hold of a
client. Vendor SDKs typically resolve their http.Client once at
initialization and keep it for the process lifetime, so reinstalling a
factory later has no effect on them — but changing this does.
Null falls back to generic fake JSON. Every explicit useMockClient
configuration is installed here, so body factories and failure responses
reach clients that were captured before the call. BifrostTestRuntime.reset
replaces or clears it.
Implementation
MockResponder? bifrostMockResponder;