exchange serialization bugfix and partial test coverage

This commit is contained in:
julian 2022-08-29 14:47:38 -06:00
parent 7043ccc9e9
commit ba576c06eb
4 changed files with 31937 additions and 11 deletions

View file

@ -18,12 +18,15 @@ abstract class ChangeNow {
static const String authority = "api.changenow.io";
static const String apiVersion = "/v1";
/// set this to override using standard http client. Useful for testing
static http.Client? client;
static Uri _buildUri(String path, Map<String, dynamic>? params) {
return Uri.https(authority, apiVersion + path, params);
}
static Future<dynamic> _makeGetRequest(Uri uri) async {
final client = http.Client();
final client = ChangeNow.client ?? http.Client();
try {
final response = await client.get(
uri,
@ -44,7 +47,7 @@ abstract class ChangeNow {
Uri uri,
Map<String, String> body,
) async {
final client = http.Client();
final client = ChangeNow.client ?? http.Client();
try {
final response = await client.post(
uri,
@ -205,8 +208,9 @@ abstract class ChangeNow {
static Future<ChangeNowResponse<Decimal>> getMinimalExchangeAmount({
required String fromTicker,
required String toTicker,
String apiKey = kChangeNowApiKey,
}) async {
Map<String, dynamic>? params = {"api_key": kChangeNowApiKey};
Map<String, dynamic>? params = {"api_key": apiKey};
final uri = _buildUri("/min-amount/${fromTicker}_$toTicker", params);
@ -292,9 +296,10 @@ abstract class ChangeNow {
// to freeze estimated amount that you got in this method. Current estimated
// amount would be valid until time in field "validUntil"
bool useRateId = true,
String apiKey = kChangeNowApiKey,
}) async {
Map<String, dynamic> params = {
"api_key": kChangeNowApiKey,
"api_key": apiKey,
"useRateId": useRateId.toString(),
};
@ -337,8 +342,10 @@ abstract class ChangeNow {
/// time and the market info gets updates, so make sure to refresh the list
/// occasionally. One time per minute is sufficient.
static Future<ChangeNowResponse<List<FixedRateMarket>>>
getAvailableFixedRateMarkets() async {
final uri = _buildUri("/market-info/fixed-rate/$kChangeNowApiKey", null);
getAvailableFixedRateMarkets({
String apiKey = kChangeNowApiKey,
}) async {
final uri = _buildUri("/market-info/fixed-rate/$apiKey", null);
try {
// json array is expected here
@ -406,6 +413,7 @@ abstract class ChangeNow {
String contactEmail = "",
String refundAddress = "",
String refundExtraId = "",
String apiKey = kChangeNowApiKey,
}) async {
final Map<String, String> map = {
"from": fromTicker,
@ -420,14 +428,14 @@ abstract class ChangeNow {
"refundExtraId": refundExtraId,
};
final uri = _buildUri("/transactions/$kChangeNowApiKey", null);
final uri = _buildUri("/transactions/$apiKey", null);
try {
// simple json object is expected here
final json = await _makePostRequest(uri, map);
// pass in date to prevent using default 1970 date
json["date"] = DateTime.now();
json["date"] = DateTime.now().toString();
try {
final value = ExchangeTransaction.fromJson(
@ -468,6 +476,7 @@ abstract class ChangeNow {
String contactEmail = "",
String refundAddress = "",
String refundExtraId = "",
String apiKey = kChangeNowApiKey,
}) async {
final Map<String, String> map = {
"from": fromTicker,
@ -483,14 +492,14 @@ abstract class ChangeNow {
"rateId": rateId,
};
final uri = _buildUri("/transactions/fixed-rate/$kChangeNowApiKey", null);
final uri = _buildUri("/transactions/fixed-rate/$apiKey", null);
try {
// simple json object is expected here
final json = await _makePostRequest(uri, map);
// pass in date to prevent using default 1970 date
json["date"] = DateTime.now();
json["date"] = DateTime.now().toString();
try {
final value = ExchangeTransaction.fromJson(
@ -520,8 +529,9 @@ abstract class ChangeNow {
static Future<ChangeNowResponse<ExchangeTransactionStatus>>
getTransactionStatus({
required String id,
String apiKey = kChangeNowApiKey,
}) async {
final uri = _buildUri("/transactions/$id/$kChangeNowApiKey", null);
final uri = _buildUri("/transactions/$id/$apiKey", null);
try {
// simple json object is expected here

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,482 @@
import 'dart:convert';
import 'package:decimal/decimal.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:http/http.dart';
import 'package:mockito/annotations.dart';
import 'package:mockito/mockito.dart';
import 'package:stackwallet/models/exchange/change_now/change_now_response.dart';
import 'package:stackwallet/models/exchange/change_now/exchange_transaction.dart';
import 'package:stackwallet/services/change_now/change_now.dart';
import 'change_now_sample_data.dart';
import 'change_now_test.mocks.dart';
@GenerateMocks([Client])
void main() {
group("getAvailableCurrencies", () {
test("getAvailableCurrencies succeeds without options", () async {
final client = MockClient();
ChangeNow.client = client;
when(client.get(
Uri.parse("https://api.changenow.io/v1/currencies"),
headers: {'Content-Type': 'application/json'},
)).thenAnswer((realInvocation) async =>
Response(jsonEncode(availableCurrenciesJSON), 200));
final result = await ChangeNow.getAvailableCurrencies();
expect(result.exception, null);
expect(result.value == null, false);
expect(result.value!.length, 538);
});
test("getAvailableCurrencies succeeds with active option", () async {
final client = MockClient();
ChangeNow.client = client;
when(client.get(
Uri.parse("https://api.changenow.io/v1/currencies?active=true"),
headers: {'Content-Type': 'application/json'},
)).thenAnswer((realInvocation) async =>
Response(jsonEncode(availableCurrenciesJSONActive), 200));
final result = await ChangeNow.getAvailableCurrencies(active: true);
expect(result.exception, null);
expect(result.value == null, false);
expect(result.value!.length, 531);
});
test("getAvailableCurrencies succeeds with fixedRate option", () async {
final client = MockClient();
ChangeNow.client = client;
when(client.get(
Uri.parse("https://api.changenow.io/v1/currencies?fixedRate=true"),
headers: {'Content-Type': 'application/json'},
)).thenAnswer((realInvocation) async =>
Response(jsonEncode(availableCurrenciesJSONFixedRate), 200));
final result = await ChangeNow.getAvailableCurrencies(fixedRate: true);
expect(result.exception, null);
expect(result.value == null, false);
expect(result.value!.length, 410);
});
test("getAvailableCurrencies succeeds with fixedRate and active options",
() async {
final client = MockClient();
ChangeNow.client = client;
when(client.get(
Uri.parse(
"https://api.changenow.io/v1/currencies?fixedRate=true&active=true"),
headers: {'Content-Type': 'application/json'},
)).thenAnswer((realInvocation) async =>
Response(jsonEncode(availableCurrenciesJSONActiveFixedRate), 200));
final result =
await ChangeNow.getAvailableCurrencies(active: true, fixedRate: true);
expect(result.exception, null);
expect(result.value == null, false);
expect(result.value!.length, 410);
});
test(
"getAvailableCurrencies fails with ChangeNowExceptionType.serializeResponseError",
() async {
final client = MockClient();
ChangeNow.client = client;
when(client.get(
Uri.parse("https://api.changenow.io/v1/currencies"),
headers: {'Content-Type': 'application/json'},
)).thenAnswer((realInvocation) async =>
Response('{"some unexpected": "but valid json data"}', 200));
final result = await ChangeNow.getAvailableCurrencies();
expect(result.exception!.type,
ChangeNowExceptionType.serializeResponseError);
expect(result.value == null, true);
});
test("getAvailableCurrencies fails for any other reason", () async {
final client = MockClient();
ChangeNow.client = client;
when(client.get(
Uri.parse("https://api.changenow.io/v1/currencies"),
headers: {'Content-Type': 'application/json'},
)).thenAnswer((realInvocation) async => Response("", 400));
final result = await ChangeNow.getAvailableCurrencies();
expect(result.exception!.type, ChangeNowExceptionType.generic);
expect(result.value == null, true);
});
});
group("getPairedCurrencies", () {
test("getPairedCurrencies succeeds without fixedRate option", () async {
final client = MockClient();
ChangeNow.client = client;
when(client.get(
Uri.parse("https://api.changenow.io/v1/currencies-to/XMR"),
headers: {'Content-Type': 'application/json'},
)).thenAnswer((realInvocation) async =>
Response(jsonEncode(getPairedCurrenciesJSON), 200));
final result = await ChangeNow.getPairedCurrencies(ticker: "XMR");
expect(result.exception, null);
expect(result.value == null, false);
expect(result.value!.length, 537);
});
test("getPairedCurrencies succeeds with fixedRate option", () async {
final client = MockClient();
ChangeNow.client = client;
when(client.get(
Uri.parse(
"https://api.changenow.io/v1/currencies-to/XMR?fixedRate=true"),
headers: {'Content-Type': 'application/json'},
)).thenAnswer((realInvocation) async =>
Response(jsonEncode(getPairedCurrenciesJSONFixedRate), 200));
final result =
await ChangeNow.getPairedCurrencies(ticker: "XMR", fixedRate: true);
expect(result.exception, null);
expect(result.value == null, false);
expect(result.value!.length, 410);
});
test(
"getPairedCurrencies fails with ChangeNowExceptionType.serializeResponseError",
() async {
final client = MockClient();
ChangeNow.client = client;
when(client.get(
Uri.parse("https://api.changenow.io/v1/currencies-to/XMR"),
headers: {'Content-Type': 'application/json'},
)).thenAnswer((realInvocation) async =>
Response('[{"some unexpected": "but valid json data"}]', 200));
final result = await ChangeNow.getPairedCurrencies(ticker: "XMR");
expect(result.exception!.type,
ChangeNowExceptionType.serializeResponseError);
expect(result.value == null, true);
});
test("getPairedCurrencies fails for any other reason", () async {
final client = MockClient();
ChangeNow.client = client;
when(client.get(
Uri.parse("https://api.changenow.io/v1/currencies"),
headers: {'Content-Type': 'application/json'},
)).thenAnswer((realInvocation) async => Response("", 400));
final result =
await ChangeNow.getPairedCurrencies(ticker: "XMR", fixedRate: true);
expect(result.exception!.type, ChangeNowExceptionType.generic);
expect(result.value == null, true);
});
});
group("getMinimalExchangeAmount", () {
test("getMinimalExchangeAmount succeeds", () async {
final client = MockClient();
ChangeNow.client = client;
when(client.get(
Uri.parse(
"https://api.changenow.io/v1/min-amount/xmr_btc?api_key=testAPIKEY"),
headers: {'Content-Type': 'application/json'},
)).thenAnswer(
(realInvocation) async => Response('{"minAmount": 42}', 200));
final result = await ChangeNow.getMinimalExchangeAmount(
fromTicker: "xmr",
toTicker: "btc",
apiKey: "testAPIKEY",
);
expect(result.exception, null);
expect(result.value == null, false);
expect(result.value, Decimal.fromInt(42));
});
test(
"getMinimalExchangeAmount fails with ChangeNowExceptionType.serializeResponseError",
() async {
final client = MockClient();
ChangeNow.client = client;
when(client.get(
Uri.parse(
"https://api.changenow.io/v1/min-amount/xmr_btc?api_key=testAPIKEY"),
headers: {'Content-Type': 'application/json'},
)).thenAnswer((realInvocation) async => Response('{"error": 42}', 200));
final result = await ChangeNow.getMinimalExchangeAmount(
fromTicker: "xmr",
toTicker: "btc",
apiKey: "testAPIKEY",
);
expect(result.exception!.type,
ChangeNowExceptionType.serializeResponseError);
expect(result.value == null, true);
});
test("getMinimalExchangeAmount fails for any other reason", () async {
final client = MockClient();
ChangeNow.client = client;
when(client.get(
Uri.parse(
"https://api.changenow.io/v1/min-amount/xmr_btc?api_key=testAPIKEY"),
headers: {'Content-Type': 'application/json'},
)).thenAnswer((realInvocation) async => Response('', 400));
final result = await ChangeNow.getMinimalExchangeAmount(
fromTicker: "xmr",
toTicker: "btc",
apiKey: "testAPIKEY",
);
expect(result.exception!.type, ChangeNowExceptionType.generic);
expect(result.value == null, true);
});
});
group("getEstimatedFixedRateExchangeAmount", () {
test("getEstimatedFixedRateExchangeAmount succeeds", () async {
final client = MockClient();
ChangeNow.client = client;
when(client.get(
Uri.parse(
"https://api.changenow.io/v1/exchange-amount/fixed-rate/10/xmr_btc?api_key=testAPIKEY&useRateId=true"),
headers: {'Content-Type': 'application/json'},
)).thenAnswer((realInvocation) async =>
Response(jsonEncode(estFixedRateExchangeAmountJSON), 200));
final result = await ChangeNow.getEstimatedFixedRateExchangeAmount(
fromTicker: "xmr",
toTicker: "btc",
fromAmount: Decimal.fromInt(10),
apiKey: "testAPIKEY",
);
expect(result.exception, null);
expect(result.value == null, false);
expect(result.value.toString(),
'EstimatedExchangeAmount: {estimatedAmount: 0.07271053, transactionSpeedForecast: 10-60, warningMessage: null, rateId: 1t2W5KBPqhycSJVYpaNZzYWLfMr0kSFe, networkFee: 0.00002408}');
});
test(
"getEstimatedFixedRateExchangeAmount fails with ChangeNowExceptionType.serializeResponseError",
() async {
final client = MockClient();
ChangeNow.client = client;
when(client.get(
Uri.parse(
"https://api.changenow.io/v1/exchange-amount/fixed-rate/10/xmr_btc?api_key=testAPIKEY&useRateId=true"),
headers: {'Content-Type': 'application/json'},
)).thenAnswer((realInvocation) async => Response('{"error": 42}', 200));
final result = await ChangeNow.getEstimatedFixedRateExchangeAmount(
fromTicker: "xmr",
toTicker: "btc",
fromAmount: Decimal.fromInt(10),
apiKey: "testAPIKEY",
);
expect(result.exception!.type,
ChangeNowExceptionType.serializeResponseError);
expect(result.value == null, true);
});
test("getEstimatedFixedRateExchangeAmount fails for any other reason",
() async {
final client = MockClient();
ChangeNow.client = client;
when(client.get(
Uri.parse(
"https://api.changenow.io/v1/exchange-amount/fixed-rate/10/xmr_btc?api_key=testAPIKEY&useRateId=true"),
headers: {'Content-Type': 'application/json'},
)).thenAnswer((realInvocation) async => Response('', 400));
final result = await ChangeNow.getEstimatedFixedRateExchangeAmount(
fromTicker: "xmr",
toTicker: "btc",
fromAmount: Decimal.fromInt(10),
apiKey: "testAPIKEY",
);
expect(result.exception!.type, ChangeNowExceptionType.generic);
expect(result.value == null, true);
});
});
group("getAvailableFixedRateMarkets", () {
test("getAvailableFixedRateMarkets succeeds", () async {
final client = MockClient();
ChangeNow.client = client;
when(client.get(
Uri.parse(
"https://api.changenow.io/v1/market-info/fixed-rate/testAPIKEY"),
headers: {'Content-Type': 'application/json'},
)).thenAnswer((realInvocation) async =>
Response(jsonEncode(fixedRateMarketsJSON), 200));
final result = await ChangeNow.getAvailableFixedRateMarkets(
apiKey: "testAPIKEY",
);
expect(result.exception, null);
expect(result.value == null, false);
expect(result.value!.length, 237);
});
test(
"getAvailableFixedRateMarkets fails with ChangeNowExceptionType.serializeResponseError",
() async {
final client = MockClient();
ChangeNow.client = client;
when(client.get(
Uri.parse(
"https://api.changenow.io/v1/market-info/fixed-rate/testAPIKEY"),
headers: {'Content-Type': 'application/json'},
)).thenAnswer((realInvocation) async => Response('{"error": 42}', 200));
final result = await ChangeNow.getAvailableFixedRateMarkets(
apiKey: "testAPIKEY",
);
expect(result.exception!.type,
ChangeNowExceptionType.serializeResponseError);
expect(result.value == null, true);
});
test("getAvailableFixedRateMarkets fails for any other reason", () async {
final client = MockClient();
ChangeNow.client = client;
when(client.get(
Uri.parse(
"https://api.changenow.io/v1/market-info/fixed-rate/testAPIKEY"),
headers: {'Content-Type': 'application/json'},
)).thenAnswer((realInvocation) async => Response('', 400));
final result = await ChangeNow.getAvailableFixedRateMarkets(
apiKey: "testAPIKEY",
);
expect(result.exception!.type, ChangeNowExceptionType.generic);
expect(result.value == null, true);
});
});
group("createStandardExchangeTransaction", () {
test("createStandardExchangeTransaction succeeds", () async {
final client = MockClient();
ChangeNow.client = client;
when(client.post(
Uri.parse("https://api.changenow.io/v1/transactions/testAPIKEY"),
headers: {'Content-Type': 'application/json'},
body:
'{"from":"xmr","to":"btc","address":"bc1qu58svs9983e2vuyqh7gq7ratf8k5qehz5k0cn5","amount":"0.3","flow":"standard","extraId":"","userId":"","contactEmail":"","refundAddress":"888tNkZrPN6JsEgekjMnABU4TBzc2Dt29EPAvkRxbANsAnjyPbb3iQ1YBRk1UXcdRsiKc9dhwMVgN5S9cQUiyoogDavup3H","refundExtraId":""}',
encoding: null,
)).thenAnswer((realInvocation) async =>
Response(jsonEncode(createStandardTransactionResponse), 200));
final result = await ChangeNow.createStandardExchangeTransaction(
fromTicker: "xmr",
toTicker: "btc",
receivingAddress: "bc1qu58svs9983e2vuyqh7gq7ratf8k5qehz5k0cn5",
amount: Decimal.parse("0.3"),
refundAddress:
"888tNkZrPN6JsEgekjMnABU4TBzc2Dt29EPAvkRxbANsAnjyPbb3iQ1YBRk1UXcdRsiKc9dhwMVgN5S9cQUiyoogDavup3H",
apiKey: "testAPIKEY",
);
expect(result.exception, null);
expect(result.value == null, false);
expect(result.value, isA<ExchangeTransaction>());
});
test(
"createStandardExchangeTransaction fails with ChangeNowExceptionType.serializeResponseError",
() async {
final client = MockClient();
ChangeNow.client = client;
when(client.post(
Uri.parse("https://api.changenow.io/v1/transactions/testAPIKEY"),
headers: {'Content-Type': 'application/json'},
body:
'{"from":"xmr","to":"btc","address":"bc1qu58svs9983e2vuyqh7gq7ratf8k5qehz5k0cn5","amount":"0.3","flow":"standard","extraId":"","userId":"","contactEmail":"","refundAddress":"888tNkZrPN6JsEgekjMnABU4TBzc2Dt29EPAvkRxbANsAnjyPbb3iQ1YBRk1UXcdRsiKc9dhwMVgN5S9cQUiyoogDavup3H","refundExtraId":""}',
encoding: null,
)).thenAnswer((realInvocation) async => Response('{"error": 42}', 200));
final result = await ChangeNow.createStandardExchangeTransaction(
fromTicker: "xmr",
toTicker: "btc",
receivingAddress: "bc1qu58svs9983e2vuyqh7gq7ratf8k5qehz5k0cn5",
amount: Decimal.parse("0.3"),
refundAddress:
"888tNkZrPN6JsEgekjMnABU4TBzc2Dt29EPAvkRxbANsAnjyPbb3iQ1YBRk1UXcdRsiKc9dhwMVgN5S9cQUiyoogDavup3H",
apiKey: "testAPIKEY",
);
expect(result.exception!.type,
ChangeNowExceptionType.serializeResponseError);
expect(result.value == null, true);
});
test("createStandardExchangeTransaction fails for any other reason",
() async {
final client = MockClient();
ChangeNow.client = client;
when(client.post(
Uri.parse("https://api.changenow.io/v1/transactions/testAPIKEY"),
headers: {'Content-Type': 'application/json'},
body:
'{"from":"xmr","to":"btc","address":"bc1qu58svs9983e2vuyqh7gq7ratf8k5qehz5k0cn5","amount":"0.3","flow":"standard","extraId":"","userId":"","contactEmail":"","refundAddress":"888tNkZrPN6JsEgekjMnABU4TBzc2Dt29EPAvkRxbANsAnjyPbb3iQ1YBRk1UXcdRsiKc9dhwMVgN5S9cQUiyoogDavup3H","refundExtraId":""}',
encoding: null,
)).thenAnswer((realInvocation) async => Response('', 400));
final result = await ChangeNow.createStandardExchangeTransaction(
fromTicker: "xmr",
toTicker: "btc",
receivingAddress: "bc1qu58svs9983e2vuyqh7gq7ratf8k5qehz5k0cn5",
amount: Decimal.parse("0.3"),
refundAddress:
"888tNkZrPN6JsEgekjMnABU4TBzc2Dt29EPAvkRxbANsAnjyPbb3iQ1YBRk1UXcdRsiKc9dhwMVgN5S9cQUiyoogDavup3H",
apiKey: "testAPIKEY",
);
expect(result.exception!.type, ChangeNowExceptionType.generic);
expect(result.value == null, true);
});
});
}

View file

@ -0,0 +1,108 @@
// Mocks generated by Mockito 5.2.0 from annotations
// in stackwallet/test/services/change_now_test.dart.
// Do not manually edit this file.
import 'dart:async' as _i5;
import 'dart:convert' as _i6;
import 'dart:typed_data' as _i7;
import 'package:http/src/base_request.dart' as _i8;
import 'package:http/src/client.dart' as _i4;
import 'package:http/src/response.dart' as _i2;
import 'package:http/src/streamed_response.dart' as _i3;
import 'package:mockito/mockito.dart' as _i1;
// ignore_for_file: type=lint
// ignore_for_file: avoid_redundant_argument_values
// ignore_for_file: avoid_setters_without_getters
// ignore_for_file: comment_references
// ignore_for_file: implementation_imports
// ignore_for_file: invalid_use_of_visible_for_testing_member
// ignore_for_file: prefer_const_constructors
// ignore_for_file: unnecessary_parenthesis
// ignore_for_file: camel_case_types
class _FakeResponse_0 extends _i1.Fake implements _i2.Response {}
class _FakeStreamedResponse_1 extends _i1.Fake implements _i3.StreamedResponse {
}
/// A class which mocks [Client].
///
/// See the documentation for Mockito's code generation for more information.
class MockClient extends _i1.Mock implements _i4.Client {
MockClient() {
_i1.throwOnMissingStub(this);
}
@override
_i5.Future<_i2.Response> head(Uri? url, {Map<String, String>? headers}) =>
(super.noSuchMethod(Invocation.method(#head, [url], {#headers: headers}),
returnValue: Future<_i2.Response>.value(_FakeResponse_0()))
as _i5.Future<_i2.Response>);
@override
_i5.Future<_i2.Response> get(Uri? url, {Map<String, String>? headers}) =>
(super.noSuchMethod(Invocation.method(#get, [url], {#headers: headers}),
returnValue: Future<_i2.Response>.value(_FakeResponse_0()))
as _i5.Future<_i2.Response>);
@override
_i5.Future<_i2.Response> post(Uri? url,
{Map<String, String>? headers,
Object? body,
_i6.Encoding? encoding}) =>
(super.noSuchMethod(
Invocation.method(#post, [url],
{#headers: headers, #body: body, #encoding: encoding}),
returnValue: Future<_i2.Response>.value(_FakeResponse_0()))
as _i5.Future<_i2.Response>);
@override
_i5.Future<_i2.Response> put(Uri? url,
{Map<String, String>? headers,
Object? body,
_i6.Encoding? encoding}) =>
(super.noSuchMethod(
Invocation.method(#put, [url],
{#headers: headers, #body: body, #encoding: encoding}),
returnValue: Future<_i2.Response>.value(_FakeResponse_0()))
as _i5.Future<_i2.Response>);
@override
_i5.Future<_i2.Response> patch(Uri? url,
{Map<String, String>? headers,
Object? body,
_i6.Encoding? encoding}) =>
(super.noSuchMethod(
Invocation.method(#patch, [url],
{#headers: headers, #body: body, #encoding: encoding}),
returnValue: Future<_i2.Response>.value(_FakeResponse_0()))
as _i5.Future<_i2.Response>);
@override
_i5.Future<_i2.Response> delete(Uri? url,
{Map<String, String>? headers,
Object? body,
_i6.Encoding? encoding}) =>
(super.noSuchMethod(
Invocation.method(#delete, [url],
{#headers: headers, #body: body, #encoding: encoding}),
returnValue: Future<_i2.Response>.value(_FakeResponse_0()))
as _i5.Future<_i2.Response>);
@override
_i5.Future<String> read(Uri? url, {Map<String, String>? headers}) =>
(super.noSuchMethod(Invocation.method(#read, [url], {#headers: headers}),
returnValue: Future<String>.value('')) as _i5.Future<String>);
@override
_i5.Future<_i7.Uint8List> readBytes(Uri? url,
{Map<String, String>? headers}) =>
(super.noSuchMethod(
Invocation.method(#readBytes, [url], {#headers: headers}),
returnValue: Future<_i7.Uint8List>.value(_i7.Uint8List(0)))
as _i5.Future<_i7.Uint8List>);
@override
_i5.Future<_i3.StreamedResponse> send(_i8.BaseRequest? request) =>
(super.noSuchMethod(Invocation.method(#send, [request]),
returnValue:
Future<_i3.StreamedResponse>.value(_FakeStreamedResponse_1()))
as _i5.Future<_i3.StreamedResponse>);
@override
void close() => super.noSuchMethod(Invocation.method(#close, []),
returnValueForMissingStub: null);
}