thenReturnInOrder method
The stub returns each responses entry once, then sticks on the last.
Useful for retry tests: [serverError, serverError, success] exercises
two retries before settling.
Implementation
void thenReturnInOrder(List<HttpResponse> responses) {
assert(
responses.isNotEmpty,
'thenReturnInOrder requires at least one response',
);
_adapter._stubs.add(
_build(
responses.map(_Reply.success).toList(growable: false),
),
);
}