stubJson method
void
stubJson(})
Stubs a successful JSON response — the common case.
Implementation
void stubJson(
HttpMethod method,
String endpoint,
Object? body, {
int statusCode = 200,
Map<String, List<String>>? headers,
}) {
stub(
method,
endpoint,
right(Response(
requestOptions: RequestOptions(path: endpoint),
statusCode: statusCode,
data: body,
headers: headers == null ? null : Headers.fromMap(headers),
)),
);
}