DVHttpStub class

What a faked host answers.

The failure paths are as short to write as the success one, because an integration test that can only produce a 200 has tested the half that was never going to be the problem.

Constructors

DVHttpStub.error(Object error)
Fails the way a broken connection does.
factory
DVHttpStub.fixture(DVHttpFixture fixture)
Replays a recorded response.
factory
DVHttpStub.json(Object? data, {int status = 200, Map<String, String> headers = const <String, String>{}})
factory
DVHttpStub.sequence(List<DVHttpStub> stubs)
The nth call gets the nth stub, and the last one repeats — a service that fails twice and then recovers.
factory
DVHttpStub.status(int status)
A bare status: DVHttpStub.status(503) exercises the degradation path.
factory
DVHttpStub.text(String text, {int status = 200, Map<String, String> headers = const <String, String>{}})
factory
DVHttpStub.timeout()
Never answers, so the host's own timeout is what the caller meets.
factory

Properties

body → List<int>
final
error → Object?
final
hashCode → int
The hash code for this object.
no setterinherited
headers → Map<String, String>
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sequence → List<DVHttpStub>
final
status → int
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited