diff --git a/packages/ndk/test/data_layer/cache_manager/mem_cache_manager_test.mocks.dart b/packages/ndk/test/data_layer/cache_manager/mem_cache_manager_test.mocks.dart index e5873c43d..573c9b8f4 100644 --- a/packages/ndk/test/data_layer/cache_manager/mem_cache_manager_test.mocks.dart +++ b/packages/ndk/test/data_layer/cache_manager/mem_cache_manager_test.mocks.dart @@ -867,6 +867,12 @@ class MockNip01Event extends _i1.Mock implements _i3.Nip01Event { ), returnValueForMissingStub: null, ); + + @override + String? getFirstTag(String? name) => (super.noSuchMethod(Invocation.method( + #getFirstTag, + [name], + )) as String?); } /// A class which mocks [Nip05]. diff --git a/packages/ndk/test/usecases/lnurl/lnurl_test.mocks.dart b/packages/ndk/test/usecases/lnurl/lnurl_test.mocks.dart index 9076e3577..2921e0557 100644 --- a/packages/ndk/test/usecases/lnurl/lnurl_test.mocks.dart +++ b/packages/ndk/test/usecases/lnurl/lnurl_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.5 from annotations +// Mocks generated by Mockito 5.4.4 from annotations // in ndk/test/usecases/lnurl/lnurl_test.dart. // Do not manually edit this file. @@ -19,21 +19,30 @@ import 'package:mockito/src/dummies.dart' as _i5; // ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member -// ignore_for_file: must_be_immutable // ignore_for_file: prefer_const_constructors // ignore_for_file: unnecessary_parenthesis // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class class _FakeResponse_0 extends _i1.SmartFake implements _i2.Response { - _FakeResponse_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeResponse_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeStreamedResponse_1 extends _i1.SmartFake implements _i2.StreamedResponse { - _FakeStreamedResponse_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeStreamedResponse_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } /// A class which mocks [Client]. @@ -45,30 +54,46 @@ class MockClient extends _i1.Mock implements _i2.Client { } @override - _i3.Future<_i2.Response> head(Uri? url, {Map? headers}) => + _i3.Future<_i2.Response> head( + Uri? url, { + Map? headers, + }) => (super.noSuchMethod( - Invocation.method(#head, [url], {#headers: headers}), - returnValue: _i3.Future<_i2.Response>.value( - _FakeResponse_0( - this, - Invocation.method(#head, [url], {#headers: headers}), - ), - ), - ) - as _i3.Future<_i2.Response>); + Invocation.method( + #head, + [url], + {#headers: headers}, + ), + returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0( + this, + Invocation.method( + #head, + [url], + {#headers: headers}, + ), + )), + ) as _i3.Future<_i2.Response>); @override - _i3.Future<_i2.Response> get(Uri? url, {Map? headers}) => + _i3.Future<_i2.Response> get( + Uri? url, { + Map? headers, + }) => (super.noSuchMethod( - Invocation.method(#get, [url], {#headers: headers}), - returnValue: _i3.Future<_i2.Response>.value( - _FakeResponse_0( - this, - Invocation.method(#get, [url], {#headers: headers}), - ), - ), - ) - as _i3.Future<_i2.Response>); + Invocation.method( + #get, + [url], + {#headers: headers}, + ), + returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0( + this, + Invocation.method( + #get, + [url], + {#headers: headers}, + ), + )), + ) as _i3.Future<_i2.Response>); @override _i3.Future<_i2.Response> post( @@ -78,23 +103,28 @@ class MockClient extends _i1.Mock implements _i2.Client { _i4.Encoding? encoding, }) => (super.noSuchMethod( - Invocation.method( - #post, - [url], - {#headers: headers, #body: body, #encoding: encoding}, - ), - returnValue: _i3.Future<_i2.Response>.value( - _FakeResponse_0( - this, - Invocation.method( - #post, - [url], - {#headers: headers, #body: body, #encoding: encoding}, - ), - ), - ), - ) - as _i3.Future<_i2.Response>); + Invocation.method( + #post, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0( + this, + Invocation.method( + #post, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + )), + ) as _i3.Future<_i2.Response>); @override _i3.Future<_i2.Response> put( @@ -104,23 +134,28 @@ class MockClient extends _i1.Mock implements _i2.Client { _i4.Encoding? encoding, }) => (super.noSuchMethod( - Invocation.method( - #put, - [url], - {#headers: headers, #body: body, #encoding: encoding}, - ), - returnValue: _i3.Future<_i2.Response>.value( - _FakeResponse_0( - this, - Invocation.method( - #put, - [url], - {#headers: headers, #body: body, #encoding: encoding}, - ), - ), - ), - ) - as _i3.Future<_i2.Response>); + Invocation.method( + #put, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0( + this, + Invocation.method( + #put, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + )), + ) as _i3.Future<_i2.Response>); @override _i3.Future<_i2.Response> patch( @@ -130,23 +165,28 @@ class MockClient extends _i1.Mock implements _i2.Client { _i4.Encoding? encoding, }) => (super.noSuchMethod( - Invocation.method( - #patch, - [url], - {#headers: headers, #body: body, #encoding: encoding}, - ), - returnValue: _i3.Future<_i2.Response>.value( - _FakeResponse_0( - this, - Invocation.method( - #patch, - [url], - {#headers: headers, #body: body, #encoding: encoding}, - ), - ), - ), - ) - as _i3.Future<_i2.Response>); + Invocation.method( + #patch, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0( + this, + Invocation.method( + #patch, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + )), + ) as _i3.Future<_i2.Response>); @override _i3.Future<_i2.Response> delete( @@ -156,36 +196,49 @@ class MockClient extends _i1.Mock implements _i2.Client { _i4.Encoding? encoding, }) => (super.noSuchMethod( - Invocation.method( - #delete, - [url], - {#headers: headers, #body: body, #encoding: encoding}, - ), - returnValue: _i3.Future<_i2.Response>.value( - _FakeResponse_0( - this, - Invocation.method( - #delete, - [url], - {#headers: headers, #body: body, #encoding: encoding}, - ), - ), - ), - ) - as _i3.Future<_i2.Response>); + Invocation.method( + #delete, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0( + this, + Invocation.method( + #delete, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + )), + ) as _i3.Future<_i2.Response>); @override - _i3.Future read(Uri? url, {Map? headers}) => + _i3.Future read( + Uri? url, { + Map? headers, + }) => (super.noSuchMethod( - Invocation.method(#read, [url], {#headers: headers}), - returnValue: _i3.Future.value( - _i5.dummyValue( - this, - Invocation.method(#read, [url], {#headers: headers}), - ), - ), - ) - as _i3.Future); + Invocation.method( + #read, + [url], + {#headers: headers}, + ), + returnValue: _i3.Future.value(_i5.dummyValue( + this, + Invocation.method( + #read, + [url], + {#headers: headers}, + ), + )), + ) as _i3.Future); @override _i3.Future<_i6.Uint8List> readBytes( @@ -193,27 +246,37 @@ class MockClient extends _i1.Mock implements _i2.Client { Map? headers, }) => (super.noSuchMethod( - Invocation.method(#readBytes, [url], {#headers: headers}), - returnValue: _i3.Future<_i6.Uint8List>.value(_i6.Uint8List(0)), - ) - as _i3.Future<_i6.Uint8List>); + Invocation.method( + #readBytes, + [url], + {#headers: headers}, + ), + returnValue: _i3.Future<_i6.Uint8List>.value(_i6.Uint8List(0)), + ) as _i3.Future<_i6.Uint8List>); @override _i3.Future<_i2.StreamedResponse> send(_i2.BaseRequest? request) => (super.noSuchMethod( - Invocation.method(#send, [request]), - returnValue: _i3.Future<_i2.StreamedResponse>.value( - _FakeStreamedResponse_1( - this, - Invocation.method(#send, [request]), - ), - ), - ) - as _i3.Future<_i2.StreamedResponse>); + Invocation.method( + #send, + [request], + ), + returnValue: + _i3.Future<_i2.StreamedResponse>.value(_FakeStreamedResponse_1( + this, + Invocation.method( + #send, + [request], + ), + )), + ) as _i3.Future<_i2.StreamedResponse>); @override void close() => super.noSuchMethod( - Invocation.method(#close, []), - returnValueForMissingStub: null, - ); + Invocation.method( + #close, + [], + ), + returnValueForMissingStub: null, + ); } diff --git a/packages/ndk/test/usecases/zaps/zap_receipt_test.dart b/packages/ndk/test/usecases/zaps/zap_receipt_test.dart new file mode 100644 index 000000000..b300aa3c5 --- /dev/null +++ b/packages/ndk/test/usecases/zaps/zap_receipt_test.dart @@ -0,0 +1,195 @@ +import 'dart:convert'; + +import 'package:mockito/annotations.dart'; +import 'package:mockito/mockito.dart'; +import 'package:ndk/domain_layer/usecases/lnurl/lnurl.dart'; +import 'package:ndk/ndk.dart'; +import 'package:test/test.dart'; + +import 'zap_receipt_test.mocks.dart'; + +// Mock classes +@GenerateMocks([Nip01Event]) +void main() { + group('ZapReceipt', () { + late MockNip01Event mockEvent; + + setUp(() { + mockEvent = MockNip01Event(); + }); + + test('fromEvent initializes correctly with valid event', () { + when(mockEvent.kind).thenReturn(9735); + when(mockEvent.pubKey).thenReturn('testPubKey'); + when(mockEvent.tags).thenReturn([ + ['bolt11', 'testBolt11'], + ['preimage', 'testPreimage'], + [ + 'description', + jsonEncode({ + 'id':'duparomana', + 'pubkey': 'testSender', + 'kind': ZapRequest.KIND, + 'sig': "sig", + 'created_at':DateTime.now().millisecondsSinceEpoch, + 'content': 'testComment', + 'pubKey': 'testSender', + 'tags': [ + ['lnurl', 'testLnurl'], + ['amount', '1000'] + ] + }) + ], + ['p', 'testRecipient'], + ['e', 'testEventId'], + ['anon', 'testAnon'], + ['P', 'testSender'] + ]); + when(mockEvent.createdAt).thenReturn(1234567890); + + final zapReceipt = ZapReceipt.fromEvent(mockEvent); + + expect(zapReceipt.pubKey, 'testPubKey'); + expect(zapReceipt.bolt11, 'testBolt11'); + expect(zapReceipt.preimage, 'testPreimage'); + expect(zapReceipt.comment, 'testComment'); + expect(zapReceipt.sender, 'testSender'); + expect(zapReceipt.lnurl, 'testLnurl'); + expect(zapReceipt.amountSats, 1); // 1000 msats = 1 sat + expect(zapReceipt.recipient, 'testRecipient'); + expect(zapReceipt.eventId, 'testEventId'); + expect(zapReceipt.anon, 'testAnon'); + expect(zapReceipt.paidAt, 1234567890); + }); + + test('fromEvent throws exception for non-nip57 event', () { + when(mockEvent.pubKey).thenReturn('testPubKey'); + when(mockEvent.createdAt).thenReturn(1234567890); + when(mockEvent.kind).thenReturn(1234); + + expect(() => ZapReceipt.fromEvent(mockEvent), throwsException); + }); + + test('isValid returns true for valid zap receipt', () { + when(mockEvent.kind).thenReturn(9735); + when(mockEvent.pubKey).thenReturn('testPubKey'); + when(mockEvent.createdAt).thenReturn(1234567890); + when(mockEvent.tags).thenReturn([ + ['bolt11', 'lnbc15u1p'], + [ + 'description', + jsonEncode({ + 'id':'duparomana', + 'pubkey': 'testSender', + 'kind': ZapRequest.KIND, + 'sig': "sig", + 'created_at':DateTime.now().millisecondsSinceEpoch, + 'content':'', + 'tags': [ + ['lnurl', 'testLnurl'], + ['amount', '1500000'] + ] + }) + ] + ]); + + final zapReceipt = ZapReceipt.fromEvent(mockEvent); + + expect( + zapReceipt.isValid( + nostrPubKey: 'testPubKey', recipientLnurl: 'testLnurl'), + isTrue); + }); + + test('isValid returns false for invalid pubKey', () { + when(mockEvent.kind).thenReturn(9735); + when(mockEvent.pubKey).thenReturn('wrongPubKey'); + when(mockEvent.createdAt).thenReturn(1234567890); + when(mockEvent.tags).thenReturn([ + ['bolt11', 'lnbc15u1p'], + [ + 'description', + jsonEncode({ + 'id':'duparomana', + 'pubkey': 'testSender', + 'kind': ZapRequest.KIND, + 'sig': "sig", + 'created_at':DateTime.now().millisecondsSinceEpoch, + 'content':'', + 'tags': [ + ['lnurl', 'testLnurl'], + ['amount', '1500000'] + ] + }) + ] + ]); + + final zapReceipt = ZapReceipt.fromEvent(mockEvent); + expect( + zapReceipt.isValid( + nostrPubKey: 'testPubKey', recipientLnurl: 'testLnurl'), + isFalse); + }); + + test('isValid returns false for mismatched amount', () { + when(mockEvent.kind).thenReturn(9735); + when(mockEvent.pubKey).thenReturn('testPubKey'); + when(mockEvent.createdAt).thenReturn(1234567890); + when(mockEvent.tags).thenReturn([ + ['bolt11', 'lnbc15u1p'], + [ + 'description', + jsonEncode({ + 'id':'duparomana', + 'pubkey': 'testSender', + 'kind': ZapRequest.KIND, + 'sig': "sig", + 'created_at':DateTime.now().millisecondsSinceEpoch, + 'content':'', + 'tags': [ + ['lnurl', 'testLnurl'], + ['amount', '2000000'] + ] + }) + ] + ]); + + final zapReceipt = ZapReceipt.fromEvent(mockEvent); + expect( + zapReceipt.isValid( + nostrPubKey: 'testPubKey', recipientLnurl: 'testLnurl'), + isFalse); + }); + + test('isValid returns false for mismatched lnurl', () { + when(mockEvent.kind).thenReturn(9735); + when(mockEvent.pubKey).thenReturn('testPubKey'); + when(mockEvent.createdAt).thenReturn(1234567890); + when(mockEvent.tags).thenReturn([ + ['bolt11', 'lnbc15u1p'], + [ + 'description', + jsonEncode({ + 'id':'duparomana', + 'pubkey': 'testSender', + 'kind': ZapRequest.KIND, + 'sig': "sig", + 'created_at':DateTime.now().millisecondsSinceEpoch, + 'content':'', + 'tags': [ + ['lnurl', 'wrongLnurl'], + ['amount', '1500000'] + ] + }) + ] + ]); + + final zapReceipt = ZapReceipt.fromEvent(mockEvent); + + expect( + zapReceipt.isValid( + nostrPubKey: 'testPubKey', recipientLnurl: 'testLnurl'), + isFalse); + }); + }); +} diff --git a/packages/ndk/test/usecases/zaps/zap_receipt_test.mocks.dart b/packages/ndk/test/usecases/zaps/zap_receipt_test.mocks.dart new file mode 100644 index 000000000..4ea34cff5 --- /dev/null +++ b/packages/ndk/test/usecases/zaps/zap_receipt_test.mocks.dart @@ -0,0 +1,201 @@ +// Mocks generated by Mockito 5.4.4 from annotations +// in ndk/test/usecases/zaps/zap_receipt_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:mockito/mockito.dart' as _i1; +import 'package:mockito/src/dummies.dart' as _i3; +import 'package:ndk/domain_layer/entities/nip_01_event.dart' as _i2; + +// 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: deprecated_member_use +// ignore_for_file: deprecated_member_use_from_same_package +// 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 +// ignore_for_file: subtype_of_sealed_class + +/// A class which mocks [Nip01Event]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockNip01Event extends _i1.Mock implements _i2.Nip01Event { + MockNip01Event() { + _i1.throwOnMissingStub(this); + } + + @override + String get id => (super.noSuchMethod( + Invocation.getter(#id), + returnValue: _i3.dummyValue( + this, + Invocation.getter(#id), + ), + ) as String); + + @override + set id(String? _id) => super.noSuchMethod( + Invocation.setter( + #id, + _id, + ), + returnValueForMissingStub: null, + ); + + @override + String get pubKey => (super.noSuchMethod( + Invocation.getter(#pubKey), + returnValue: _i3.dummyValue( + this, + Invocation.getter(#pubKey), + ), + ) as String); + + @override + int get createdAt => (super.noSuchMethod( + Invocation.getter(#createdAt), + returnValue: 0, + ) as int); + + @override + set createdAt(int? _createdAt) => super.noSuchMethod( + Invocation.setter( + #createdAt, + _createdAt, + ), + returnValueForMissingStub: null, + ); + + @override + int get kind => (super.noSuchMethod( + Invocation.getter(#kind), + returnValue: 0, + ) as int); + + @override + List> get tags => (super.noSuchMethod( + Invocation.getter(#tags), + returnValue: >[], + ) as List>); + + @override + set tags(List>? _tags) => super.noSuchMethod( + Invocation.setter( + #tags, + _tags, + ), + returnValueForMissingStub: null, + ); + + @override + String get content => (super.noSuchMethod( + Invocation.getter(#content), + returnValue: _i3.dummyValue( + this, + Invocation.getter(#content), + ), + ) as String); + + @override + set content(String? _content) => super.noSuchMethod( + Invocation.setter( + #content, + _content, + ), + returnValueForMissingStub: null, + ); + + @override + String get sig => (super.noSuchMethod( + Invocation.getter(#sig), + returnValue: _i3.dummyValue( + this, + Invocation.getter(#sig), + ), + ) as String); + + @override + set sig(String? _sig) => super.noSuchMethod( + Invocation.setter( + #sig, + _sig, + ), + returnValueForMissingStub: null, + ); + + @override + set validSig(bool? _validSig) => super.noSuchMethod( + Invocation.setter( + #validSig, + _validSig, + ), + returnValueForMissingStub: null, + ); + + @override + List get sources => (super.noSuchMethod( + Invocation.getter(#sources), + returnValue: [], + ) as List); + + @override + set sources(List? _sources) => super.noSuchMethod( + Invocation.setter( + #sources, + _sources, + ), + returnValueForMissingStub: null, + ); + + @override + bool get isIdValid => (super.noSuchMethod( + Invocation.getter(#isIdValid), + returnValue: false, + ) as bool); + + @override + List get tTags => (super.noSuchMethod( + Invocation.getter(#tTags), + returnValue: [], + ) as List); + + @override + List get pTags => (super.noSuchMethod( + Invocation.getter(#pTags), + returnValue: [], + ) as List); + + @override + List get replyETags => (super.noSuchMethod( + Invocation.getter(#replyETags), + returnValue: [], + ) as List); + + @override + Map toJson() => (super.noSuchMethod( + Invocation.method( + #toJson, + [], + ), + returnValue: {}, + ) as Map); + + @override + void sign(String? privateKey) => super.noSuchMethod( + Invocation.method( + #sign, + [privateKey], + ), + returnValueForMissingStub: null, + ); + + @override + String? getFirstTag(String? name) => (super.noSuchMethod(Invocation.method( + #getFirstTag, + [name], + )) as String?); +} diff --git a/packages/ndk/test/usecases/zaps/zaps_test.mocks.dart b/packages/ndk/test/usecases/zaps/zaps_test.mocks.dart new file mode 100644 index 000000000..3cfe3c00a --- /dev/null +++ b/packages/ndk/test/usecases/zaps/zaps_test.mocks.dart @@ -0,0 +1,282 @@ +// Mocks generated by Mockito 5.4.4 from annotations +// in ndk/test/usecases/zaps/zaps_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i3; +import 'dart:convert' as _i4; +import 'dart:typed_data' as _i6; + +import 'package:http/http.dart' as _i2; +import 'package:mockito/mockito.dart' as _i1; +import 'package:mockito/src/dummies.dart' as _i5; + +// 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: deprecated_member_use +// ignore_for_file: deprecated_member_use_from_same_package +// 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 +// ignore_for_file: subtype_of_sealed_class + +class _FakeResponse_0 extends _i1.SmartFake implements _i2.Response { + _FakeResponse_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeStreamedResponse_1 extends _i1.SmartFake + implements _i2.StreamedResponse { + _FakeStreamedResponse_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [Client]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockClient extends _i1.Mock implements _i2.Client { + MockClient() { + _i1.throwOnMissingStub(this); + } + + @override + _i3.Future<_i2.Response> head( + Uri? url, { + Map? headers, + }) => + (super.noSuchMethod( + Invocation.method( + #head, + [url], + {#headers: headers}, + ), + returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0( + this, + Invocation.method( + #head, + [url], + {#headers: headers}, + ), + )), + ) as _i3.Future<_i2.Response>); + + @override + _i3.Future<_i2.Response> get( + Uri? url, { + Map? headers, + }) => + (super.noSuchMethod( + Invocation.method( + #get, + [url], + {#headers: headers}, + ), + returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0( + this, + Invocation.method( + #get, + [url], + {#headers: headers}, + ), + )), + ) as _i3.Future<_i2.Response>); + + @override + _i3.Future<_i2.Response> post( + Uri? url, { + Map? headers, + Object? body, + _i4.Encoding? encoding, + }) => + (super.noSuchMethod( + Invocation.method( + #post, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0( + this, + Invocation.method( + #post, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + )), + ) as _i3.Future<_i2.Response>); + + @override + _i3.Future<_i2.Response> put( + Uri? url, { + Map? headers, + Object? body, + _i4.Encoding? encoding, + }) => + (super.noSuchMethod( + Invocation.method( + #put, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0( + this, + Invocation.method( + #put, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + )), + ) as _i3.Future<_i2.Response>); + + @override + _i3.Future<_i2.Response> patch( + Uri? url, { + Map? headers, + Object? body, + _i4.Encoding? encoding, + }) => + (super.noSuchMethod( + Invocation.method( + #patch, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0( + this, + Invocation.method( + #patch, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + )), + ) as _i3.Future<_i2.Response>); + + @override + _i3.Future<_i2.Response> delete( + Uri? url, { + Map? headers, + Object? body, + _i4.Encoding? encoding, + }) => + (super.noSuchMethod( + Invocation.method( + #delete, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0( + this, + Invocation.method( + #delete, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + )), + ) as _i3.Future<_i2.Response>); + + @override + _i3.Future read( + Uri? url, { + Map? headers, + }) => + (super.noSuchMethod( + Invocation.method( + #read, + [url], + {#headers: headers}, + ), + returnValue: _i3.Future.value(_i5.dummyValue( + this, + Invocation.method( + #read, + [url], + {#headers: headers}, + ), + )), + ) as _i3.Future); + + @override + _i3.Future<_i6.Uint8List> readBytes( + Uri? url, { + Map? headers, + }) => + (super.noSuchMethod( + Invocation.method( + #readBytes, + [url], + {#headers: headers}, + ), + returnValue: _i3.Future<_i6.Uint8List>.value(_i6.Uint8List(0)), + ) as _i3.Future<_i6.Uint8List>); + + @override + _i3.Future<_i2.StreamedResponse> send(_i2.BaseRequest? request) => + (super.noSuchMethod( + Invocation.method( + #send, + [request], + ), + returnValue: + _i3.Future<_i2.StreamedResponse>.value(_FakeStreamedResponse_1( + this, + Invocation.method( + #send, + [request], + ), + )), + ) as _i3.Future<_i2.StreamedResponse>); + + @override + void close() => super.noSuchMethod( + Invocation.method( + #close, + [], + ), + returnValueForMissingStub: null, + ); +}