diff --git a/CHANGELOG.md b/CHANGELOG.md index 550780c..730ae81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [3.2.2] - 2023/08/27 +* Updated dependencies (thanks [Jason Held](https://github.com/jheld)) +* Fix for LinkedInOAuth2Client client (thanks [Abhishek-Khanal](https://github.com/Abhishek-Khanal)) + ## [3.2.1] - 2023/03/12 * Updated dependencies diff --git a/pubspec.yaml b/pubspec.yaml index 3258ff6..26c8255 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -21,7 +21,7 @@ dev_dependencies: flutter_test: sdk: flutter build_runner: ^2.1.7 - mockito: ^5.0.17 + mockito: ^5.4.2 flutter_lints: ^2.0.0 # The following section is specific to Flutter. diff --git a/test/oauth2_client_test.mocks.dart b/test/oauth2_client_test.mocks.dart index cd872f0..ce6434e 100644 --- a/test/oauth2_client_test.mocks.dart +++ b/test/oauth2_client_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.3.0 from annotations +// Mocks generated by Mockito 5.4.2 from annotations // in oauth2_client/test/oauth2_client_test.dart. // Do not manually edit this file. @@ -23,14 +23,24 @@ import 'package:oauth2_client/src/base_web_auth.dart' as _i3; // 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 [BaseWebAuth]. @@ -42,19 +52,25 @@ class MockBaseWebAuth extends _i1.Mock implements _i3.BaseWebAuth { } @override - _i4.Future authenticate( - {String? callbackUrlScheme, - String? url, - String? redirectUrl, - Map? opts}) => + _i4.Future authenticate({ + required String? callbackUrlScheme, + required String? url, + required String? redirectUrl, + Map? opts, + }) => (super.noSuchMethod( - Invocation.method(#authenticate, [], { + Invocation.method( + #authenticate, + [], + { #callbackUrlScheme: callbackUrlScheme, #url: url, #redirectUrl: redirectUrl, - #opts: opts - }), - returnValue: _i4.Future.value('')) as _i4.Future); + #opts: opts, + }, + ), + returnValue: _i4.Future.value(''), + ) as _i4.Future); } /// A class which mocks [Client]. @@ -66,100 +82,213 @@ class MockClient extends _i1.Mock implements _i2.Client { } @override - _i4.Future<_i2.Response> head(Uri? url, {Map? headers}) => - (super.noSuchMethod(Invocation.method(#head, [url], {#headers: headers}), - returnValue: _i4.Future<_i2.Response>.value(_FakeResponse_0( - this, Invocation.method(#head, [url], {#headers: headers})))) - as _i4.Future<_i2.Response>); + _i4.Future<_i2.Response> head( + Uri? url, { + Map? headers, + }) => + (super.noSuchMethod( + Invocation.method( + #head, + [url], + {#headers: headers}, + ), + returnValue: _i4.Future<_i2.Response>.value(_FakeResponse_0( + this, + Invocation.method( + #head, + [url], + {#headers: headers}, + ), + )), + ) as _i4.Future<_i2.Response>); @override - _i4.Future<_i2.Response> get(Uri? url, {Map? headers}) => - (super.noSuchMethod(Invocation.method(#get, [url], {#headers: headers}), - returnValue: _i4.Future<_i2.Response>.value(_FakeResponse_0( - this, Invocation.method(#get, [url], {#headers: headers})))) - as _i4.Future<_i2.Response>); + _i4.Future<_i2.Response> get( + Uri? url, { + Map? headers, + }) => + (super.noSuchMethod( + Invocation.method( + #get, + [url], + {#headers: headers}, + ), + returnValue: _i4.Future<_i2.Response>.value(_FakeResponse_0( + this, + Invocation.method( + #get, + [url], + {#headers: headers}, + ), + )), + ) as _i4.Future<_i2.Response>); @override - _i4.Future<_i2.Response> post(Uri? url, - {Map? headers, - Object? body, - _i5.Encoding? encoding}) => - (super - .noSuchMethod(Invocation.method(#post, [url], {#headers: headers, #body: body, #encoding: encoding}), - returnValue: _i4.Future<_i2.Response>.value(_FakeResponse_0( - this, - Invocation.method(#post, [ - url - ], { - #headers: headers, - #body: body, - #encoding: encoding - })))) as _i4.Future<_i2.Response>); + _i4.Future<_i2.Response> post( + Uri? url, { + Map? headers, + Object? body, + _i5.Encoding? encoding, + }) => + (super.noSuchMethod( + Invocation.method( + #post, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + returnValue: _i4.Future<_i2.Response>.value(_FakeResponse_0( + this, + Invocation.method( + #post, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + )), + ) as _i4.Future<_i2.Response>); @override - _i4.Future<_i2.Response> put(Uri? url, - {Map? headers, - Object? body, - _i5.Encoding? encoding}) => - (super - .noSuchMethod(Invocation.method(#put, [url], {#headers: headers, #body: body, #encoding: encoding}), - returnValue: _i4.Future<_i2.Response>.value(_FakeResponse_0( - this, - Invocation.method(#put, [ - url - ], { - #headers: headers, - #body: body, - #encoding: encoding - })))) as _i4.Future<_i2.Response>); + _i4.Future<_i2.Response> put( + Uri? url, { + Map? headers, + Object? body, + _i5.Encoding? encoding, + }) => + (super.noSuchMethod( + Invocation.method( + #put, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + returnValue: _i4.Future<_i2.Response>.value(_FakeResponse_0( + this, + Invocation.method( + #put, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + )), + ) as _i4.Future<_i2.Response>); @override - _i4.Future<_i2.Response> patch(Uri? url, - {Map? headers, - Object? body, - _i5.Encoding? encoding}) => - (super - .noSuchMethod(Invocation.method(#patch, [url], {#headers: headers, #body: body, #encoding: encoding}), - returnValue: _i4.Future<_i2.Response>.value(_FakeResponse_0( - this, - Invocation.method(#patch, [ - url - ], { - #headers: headers, - #body: body, - #encoding: encoding - })))) as _i4.Future<_i2.Response>); + _i4.Future<_i2.Response> patch( + Uri? url, { + Map? headers, + Object? body, + _i5.Encoding? encoding, + }) => + (super.noSuchMethod( + Invocation.method( + #patch, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + returnValue: _i4.Future<_i2.Response>.value(_FakeResponse_0( + this, + Invocation.method( + #patch, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + )), + ) as _i4.Future<_i2.Response>); @override - _i4.Future<_i2.Response> delete(Uri? url, - {Map? headers, - Object? body, - _i5.Encoding? encoding}) => - (super - .noSuchMethod(Invocation.method(#delete, [url], {#headers: headers, #body: body, #encoding: encoding}), - returnValue: _i4.Future<_i2.Response>.value(_FakeResponse_0( - this, - Invocation.method(#delete, [ - url - ], { - #headers: headers, - #body: body, - #encoding: encoding - })))) as _i4.Future<_i2.Response>); + _i4.Future<_i2.Response> delete( + Uri? url, { + Map? headers, + Object? body, + _i5.Encoding? encoding, + }) => + (super.noSuchMethod( + Invocation.method( + #delete, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + returnValue: _i4.Future<_i2.Response>.value(_FakeResponse_0( + this, + Invocation.method( + #delete, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + )), + ) as _i4.Future<_i2.Response>); @override - _i4.Future read(Uri? url, {Map? headers}) => - (super.noSuchMethod(Invocation.method(#read, [url], {#headers: headers}), - returnValue: _i4.Future.value('')) as _i4.Future); + _i4.Future read( + Uri? url, { + Map? headers, + }) => + (super.noSuchMethod( + Invocation.method( + #read, + [url], + {#headers: headers}, + ), + returnValue: _i4.Future.value(''), + ) as _i4.Future); @override - _i4.Future<_i6.Uint8List> readBytes(Uri? url, - {Map? headers}) => + _i4.Future<_i6.Uint8List> readBytes( + Uri? url, { + Map? headers, + }) => (super.noSuchMethod( - Invocation.method(#readBytes, [url], {#headers: headers}), - returnValue: _i4.Future<_i6.Uint8List>.value(_i6.Uint8List(0))) - as _i4.Future<_i6.Uint8List>); + Invocation.method( + #readBytes, + [url], + {#headers: headers}, + ), + returnValue: _i4.Future<_i6.Uint8List>.value(_i6.Uint8List(0)), + ) as _i4.Future<_i6.Uint8List>); @override _i4.Future<_i2.StreamedResponse> send(_i2.BaseRequest? request) => - (super.noSuchMethod(Invocation.method(#send, [request]), - returnValue: _i4.Future<_i2.StreamedResponse>.value( - _FakeStreamedResponse_1( - this, Invocation.method(#send, [request])))) - as _i4.Future<_i2.StreamedResponse>); + (super.noSuchMethod( + Invocation.method( + #send, + [request], + ), + returnValue: + _i4.Future<_i2.StreamedResponse>.value(_FakeStreamedResponse_1( + this, + Invocation.method( + #send, + [request], + ), + )), + ) as _i4.Future<_i2.StreamedResponse>); @override - void close() => super.noSuchMethod(Invocation.method(#close, []), - returnValueForMissingStub: null); + void close() => super.noSuchMethod( + Invocation.method( + #close, + [], + ), + returnValueForMissingStub: null, + ); } diff --git a/test/oauth2_helper_test.mocks.dart b/test/oauth2_helper_test.mocks.dart index ca03fc9..f08d8cc 100644 --- a/test/oauth2_helper_test.mocks.dart +++ b/test/oauth2_helper_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.3.0 from annotations +// Mocks generated by Mockito 5.4.2 from annotations // in oauth2_client/test/oauth2_helper_test.dart. // Do not manually edit this file. @@ -29,42 +29,77 @@ import 'package:oauth2_client/src/token_storage.dart' as _i12; // ignore_for_file: subtype_of_sealed_class class _FakeBaseWebAuth_0 extends _i1.SmartFake implements _i2.BaseWebAuth { - _FakeBaseWebAuth_0(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeBaseWebAuth_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeAccessTokenResponse_1 extends _i1.SmartFake implements _i3.AccessTokenResponse { - _FakeAccessTokenResponse_1(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeAccessTokenResponse_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeAuthorizationResponse_2 extends _i1.SmartFake implements _i4.AuthorizationResponse { - _FakeAuthorizationResponse_2(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeAuthorizationResponse_2( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeOAuth2Response_3 extends _i1.SmartFake implements _i5.OAuth2Response { - _FakeOAuth2Response_3(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeOAuth2Response_3( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeResponse_4 extends _i1.SmartFake implements _i6.Response { - _FakeResponse_4(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeResponse_4( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeStreamedResponse_5 extends _i1.SmartFake implements _i6.StreamedResponse { - _FakeStreamedResponse_5(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeStreamedResponse_5( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } class _FakeBaseStorage_6 extends _i1.SmartFake implements _i7.BaseStorage { - _FakeBaseStorage_6(Object parent, Invocation parentInvocation) - : super(parent, parentInvocation); + _FakeBaseStorage_6( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); } /// A class which mocks [OAuth2Client]. @@ -76,84 +111,132 @@ class MockOAuth2Client extends _i1.Mock implements _i8.OAuth2Client { } @override - String get redirectUri => - (super.noSuchMethod(Invocation.getter(#redirectUri), returnValue: '') - as String); + String get redirectUri => (super.noSuchMethod( + Invocation.getter(#redirectUri), + returnValue: '', + ) as String); @override - set redirectUri(String? _redirectUri) => - super.noSuchMethod(Invocation.setter(#redirectUri, _redirectUri), - returnValueForMissingStub: null); + set redirectUri(String? _redirectUri) => super.noSuchMethod( + Invocation.setter( + #redirectUri, + _redirectUri, + ), + returnValueForMissingStub: null, + ); @override - String get customUriScheme => - (super.noSuchMethod(Invocation.getter(#customUriScheme), returnValue: '') - as String); + String get customUriScheme => (super.noSuchMethod( + Invocation.getter(#customUriScheme), + returnValue: '', + ) as String); @override - set customUriScheme(String? _customUriScheme) => - super.noSuchMethod(Invocation.setter(#customUriScheme, _customUriScheme), - returnValueForMissingStub: null); + set customUriScheme(String? _customUriScheme) => super.noSuchMethod( + Invocation.setter( + #customUriScheme, + _customUriScheme, + ), + returnValueForMissingStub: null, + ); @override - String get tokenUrl => - (super.noSuchMethod(Invocation.getter(#tokenUrl), returnValue: '') - as String); + String get tokenUrl => (super.noSuchMethod( + Invocation.getter(#tokenUrl), + returnValue: '', + ) as String); @override - set tokenUrl(String? _tokenUrl) => - super.noSuchMethod(Invocation.setter(#tokenUrl, _tokenUrl), - returnValueForMissingStub: null); + set tokenUrl(String? _tokenUrl) => super.noSuchMethod( + Invocation.setter( + #tokenUrl, + _tokenUrl, + ), + returnValueForMissingStub: null, + ); @override - set refreshUrl(String? _refreshUrl) => - super.noSuchMethod(Invocation.setter(#refreshUrl, _refreshUrl), - returnValueForMissingStub: null); + set refreshUrl(String? _refreshUrl) => super.noSuchMethod( + Invocation.setter( + #refreshUrl, + _refreshUrl, + ), + returnValueForMissingStub: null, + ); @override - set revokeUrl(String? _revokeUrl) => - super.noSuchMethod(Invocation.setter(#revokeUrl, _revokeUrl), - returnValueForMissingStub: null); + set revokeUrl(String? _revokeUrl) => super.noSuchMethod( + Invocation.setter( + #revokeUrl, + _revokeUrl, + ), + returnValueForMissingStub: null, + ); @override - String get authorizeUrl => - (super.noSuchMethod(Invocation.getter(#authorizeUrl), returnValue: '') - as String); + String get authorizeUrl => (super.noSuchMethod( + Invocation.getter(#authorizeUrl), + returnValue: '', + ) as String); @override - set authorizeUrl(String? _authorizeUrl) => - super.noSuchMethod(Invocation.setter(#authorizeUrl, _authorizeUrl), - returnValueForMissingStub: null); + set authorizeUrl(String? _authorizeUrl) => super.noSuchMethod( + Invocation.setter( + #authorizeUrl, + _authorizeUrl, + ), + returnValueForMissingStub: null, + ); @override - String get scopeSeparator => - (super.noSuchMethod(Invocation.getter(#scopeSeparator), returnValue: '') - as String); + String get scopeSeparator => (super.noSuchMethod( + Invocation.getter(#scopeSeparator), + returnValue: '', + ) as String); @override - set scopeSeparator(String? _scopeSeparator) => - super.noSuchMethod(Invocation.setter(#scopeSeparator, _scopeSeparator), - returnValueForMissingStub: null); + set scopeSeparator(String? _scopeSeparator) => super.noSuchMethod( + Invocation.setter( + #scopeSeparator, + _scopeSeparator, + ), + returnValueForMissingStub: null, + ); @override - _i2.BaseWebAuth get webAuthClient => - (super.noSuchMethod(Invocation.getter(#webAuthClient), - returnValue: - _FakeBaseWebAuth_0(this, Invocation.getter(#webAuthClient))) - as _i2.BaseWebAuth); + _i2.BaseWebAuth get webAuthClient => (super.noSuchMethod( + Invocation.getter(#webAuthClient), + returnValue: _FakeBaseWebAuth_0( + this, + Invocation.getter(#webAuthClient), + ), + ) as _i2.BaseWebAuth); @override - set webAuthClient(_i2.BaseWebAuth? _webAuthClient) => - super.noSuchMethod(Invocation.setter(#webAuthClient, _webAuthClient), - returnValueForMissingStub: null); + set webAuthClient(_i2.BaseWebAuth? _webAuthClient) => super.noSuchMethod( + Invocation.setter( + #webAuthClient, + _webAuthClient, + ), + returnValueForMissingStub: null, + ); @override _i8.CredentialsLocation get credentialsLocation => (super.noSuchMethod( - Invocation.getter(#credentialsLocation), - returnValue: _i8.CredentialsLocation.header) as _i8.CredentialsLocation); + Invocation.getter(#credentialsLocation), + returnValue: _i8.CredentialsLocation.header, + ) as _i8.CredentialsLocation); @override set credentialsLocation(_i8.CredentialsLocation? _credentialsLocation) => super.noSuchMethod( - Invocation.setter(#credentialsLocation, _credentialsLocation), - returnValueForMissingStub: null); - @override - _i9.Future<_i3.AccessTokenResponse> getTokenWithImplicitGrantFlow( - {String? clientId, - List? scopes, - bool? enableState = true, - String? state, - dynamic httpClient, - _i2.BaseWebAuth? webAuthClient, - Map? webAuthOpts, - Map? customParams}) => + Invocation.setter( + #credentialsLocation, + _credentialsLocation, + ), + returnValueForMissingStub: null, + ); + @override + _i9.Future<_i3.AccessTokenResponse> getTokenWithImplicitGrantFlow({ + required String? clientId, + List? scopes, + bool? enableState = true, + String? state, + dynamic httpClient, + _i2.BaseWebAuth? webAuthClient, + Map? webAuthOpts, + Map? customParams, + }) => (super.noSuchMethod( - Invocation.method(#getTokenWithImplicitGrantFlow, [], { + Invocation.method( + #getTokenWithImplicitGrantFlow, + [], + { #clientId: clientId, #scopes: scopes, #enableState: enableState, @@ -161,39 +244,50 @@ class MockOAuth2Client extends _i1.Mock implements _i8.OAuth2Client { #httpClient: httpClient, #webAuthClient: webAuthClient, #webAuthOpts: webAuthOpts, - #customParams: customParams - }), - returnValue: _i9.Future<_i3.AccessTokenResponse>.value( - _FakeAccessTokenResponse_1( - this, - Invocation.method(#getTokenWithImplicitGrantFlow, [], { - #clientId: clientId, - #scopes: scopes, - #enableState: enableState, - #state: state, - #httpClient: httpClient, - #webAuthClient: webAuthClient, - #webAuthOpts: webAuthOpts, - #customParams: customParams - })))) as _i9.Future<_i3.AccessTokenResponse>); - @override - _i9.Future<_i3.AccessTokenResponse> getTokenWithAuthCodeFlow( - {String? clientId, - List? scopes, - String? clientSecret, - bool? enablePKCE = true, - bool? enableState = true, - String? state, - String? codeVerifier, - Function? afterAuthorizationCodeCb, - Map? authCodeParams, - Map? accessTokenParams, - Map? accessTokenHeaders, - dynamic httpClient, - _i2.BaseWebAuth? webAuthClient, - Map? webAuthOpts}) => + #customParams: customParams, + }, + ), + returnValue: _i9.Future<_i3.AccessTokenResponse>.value( + _FakeAccessTokenResponse_1( + this, + Invocation.method( + #getTokenWithImplicitGrantFlow, + [], + { + #clientId: clientId, + #scopes: scopes, + #enableState: enableState, + #state: state, + #httpClient: httpClient, + #webAuthClient: webAuthClient, + #webAuthOpts: webAuthOpts, + #customParams: customParams, + }, + ), + )), + ) as _i9.Future<_i3.AccessTokenResponse>); + @override + _i9.Future<_i3.AccessTokenResponse> getTokenWithAuthCodeFlow({ + required String? clientId, + List? scopes, + String? clientSecret, + bool? enablePKCE = true, + bool? enableState = true, + String? state, + String? codeVerifier, + Function? afterAuthorizationCodeCb, + Map? authCodeParams, + Map? accessTokenParams, + Map? accessTokenHeaders, + dynamic httpClient, + _i2.BaseWebAuth? webAuthClient, + Map? webAuthOpts, + }) => (super.noSuchMethod( - Invocation.method(#getTokenWithAuthCodeFlow, [], { + Invocation.method( + #getTokenWithAuthCodeFlow, + [], + { #clientId: clientId, #scopes: scopes, #clientSecret: clientSecret, @@ -207,64 +301,86 @@ class MockOAuth2Client extends _i1.Mock implements _i8.OAuth2Client { #accessTokenHeaders: accessTokenHeaders, #httpClient: httpClient, #webAuthClient: webAuthClient, - #webAuthOpts: webAuthOpts - }), - returnValue: _i9.Future<_i3.AccessTokenResponse>.value( - _FakeAccessTokenResponse_1( - this, - Invocation.method(#getTokenWithAuthCodeFlow, [], { - #clientId: clientId, - #scopes: scopes, - #clientSecret: clientSecret, - #enablePKCE: enablePKCE, - #enableState: enableState, - #state: state, - #codeVerifier: codeVerifier, - #afterAuthorizationCodeCb: afterAuthorizationCodeCb, - #authCodeParams: authCodeParams, - #accessTokenParams: accessTokenParams, - #accessTokenHeaders: accessTokenHeaders, - #httpClient: httpClient, - #webAuthClient: webAuthClient, - #webAuthOpts: webAuthOpts - })))) as _i9.Future<_i3.AccessTokenResponse>); - @override - _i9.Future<_i3.AccessTokenResponse> getTokenWithClientCredentialsFlow( - {String? clientId, - String? clientSecret, - List? scopes, - Map? customHeaders, - dynamic httpClient}) => + #webAuthOpts: webAuthOpts, + }, + ), + returnValue: _i9.Future<_i3.AccessTokenResponse>.value( + _FakeAccessTokenResponse_1( + this, + Invocation.method( + #getTokenWithAuthCodeFlow, + [], + { + #clientId: clientId, + #scopes: scopes, + #clientSecret: clientSecret, + #enablePKCE: enablePKCE, + #enableState: enableState, + #state: state, + #codeVerifier: codeVerifier, + #afterAuthorizationCodeCb: afterAuthorizationCodeCb, + #authCodeParams: authCodeParams, + #accessTokenParams: accessTokenParams, + #accessTokenHeaders: accessTokenHeaders, + #httpClient: httpClient, + #webAuthClient: webAuthClient, + #webAuthOpts: webAuthOpts, + }, + ), + )), + ) as _i9.Future<_i3.AccessTokenResponse>); + @override + _i9.Future<_i3.AccessTokenResponse> getTokenWithClientCredentialsFlow({ + required String? clientId, + required String? clientSecret, + List? scopes, + Map? customHeaders, + dynamic httpClient, + }) => (super.noSuchMethod( - Invocation.method(#getTokenWithClientCredentialsFlow, [], { + Invocation.method( + #getTokenWithClientCredentialsFlow, + [], + { #clientId: clientId, #clientSecret: clientSecret, #scopes: scopes, #customHeaders: customHeaders, - #httpClient: httpClient - }), - returnValue: _i9.Future<_i3.AccessTokenResponse>.value( - _FakeAccessTokenResponse_1( - this, - Invocation.method(#getTokenWithClientCredentialsFlow, [], { - #clientId: clientId, - #clientSecret: clientSecret, - #scopes: scopes, - #customHeaders: customHeaders, - #httpClient: httpClient - })))) as _i9.Future<_i3.AccessTokenResponse>); - @override - _i9.Future<_i4.AuthorizationResponse> requestAuthorization( - {String? clientId, - List? scopes, - String? codeChallenge, - bool? enableState = true, - String? state, - Map? customParams, - _i2.BaseWebAuth? webAuthClient, - Map? webAuthOpts}) => + #httpClient: httpClient, + }, + ), + returnValue: _i9.Future<_i3.AccessTokenResponse>.value( + _FakeAccessTokenResponse_1( + this, + Invocation.method( + #getTokenWithClientCredentialsFlow, + [], + { + #clientId: clientId, + #clientSecret: clientSecret, + #scopes: scopes, + #customHeaders: customHeaders, + #httpClient: httpClient, + }, + ), + )), + ) as _i9.Future<_i3.AccessTokenResponse>); + @override + _i9.Future<_i4.AuthorizationResponse> requestAuthorization({ + required String? clientId, + List? scopes, + String? codeChallenge, + bool? enableState = true, + String? state, + Map? customParams, + _i2.BaseWebAuth? webAuthClient, + Map? webAuthOpts, + }) => (super.noSuchMethod( - Invocation.method(#requestAuthorization, [], { + Invocation.method( + #requestAuthorization, + [], + { #clientId: clientId, #scopes: scopes, #codeChallenge: codeChallenge, @@ -272,33 +388,44 @@ class MockOAuth2Client extends _i1.Mock implements _i8.OAuth2Client { #state: state, #customParams: customParams, #webAuthClient: webAuthClient, - #webAuthOpts: webAuthOpts - }), - returnValue: _i9.Future<_i4.AuthorizationResponse>.value( - _FakeAuthorizationResponse_2( - this, - Invocation.method(#requestAuthorization, [], { - #clientId: clientId, - #scopes: scopes, - #codeChallenge: codeChallenge, - #enableState: enableState, - #state: state, - #customParams: customParams, - #webAuthClient: webAuthClient, - #webAuthOpts: webAuthOpts - })))) as _i9.Future<_i4.AuthorizationResponse>); - @override - _i9.Future<_i3.AccessTokenResponse> requestAccessToken( - {String? code, - String? clientId, - String? clientSecret, - String? codeVerifier, - List? scopes, - Map? customParams, - Map? customHeaders, - dynamic httpClient}) => + #webAuthOpts: webAuthOpts, + }, + ), + returnValue: _i9.Future<_i4.AuthorizationResponse>.value( + _FakeAuthorizationResponse_2( + this, + Invocation.method( + #requestAuthorization, + [], + { + #clientId: clientId, + #scopes: scopes, + #codeChallenge: codeChallenge, + #enableState: enableState, + #state: state, + #customParams: customParams, + #webAuthClient: webAuthClient, + #webAuthOpts: webAuthOpts, + }, + ), + )), + ) as _i9.Future<_i4.AuthorizationResponse>); + @override + _i9.Future<_i3.AccessTokenResponse> requestAccessToken({ + required String? code, + required String? clientId, + String? clientSecret, + String? codeVerifier, + List? scopes, + Map? customParams, + Map? customHeaders, + dynamic httpClient, + }) => (super.noSuchMethod( - Invocation.method(#requestAccessToken, [], { + Invocation.method( + #requestAccessToken, + [], + { #code: code, #clientId: clientId, #clientSecret: clientSecret, @@ -306,98 +433,168 @@ class MockOAuth2Client extends _i1.Mock implements _i8.OAuth2Client { #scopes: scopes, #customParams: customParams, #customHeaders: customHeaders, - #httpClient: httpClient - }), - returnValue: _i9.Future<_i3.AccessTokenResponse>.value( - _FakeAccessTokenResponse_1( - this, - Invocation.method(#requestAccessToken, [], { - #code: code, - #clientId: clientId, - #clientSecret: clientSecret, - #codeVerifier: codeVerifier, - #scopes: scopes, - #customParams: customParams, - #customHeaders: customHeaders, - #httpClient: httpClient - })))) as _i9.Future<_i3.AccessTokenResponse>); - @override - _i9.Future<_i3.AccessTokenResponse> refreshToken(String? refreshToken, - {dynamic httpClient, - String? clientId, - String? clientSecret, - List? scopes}) => + #httpClient: httpClient, + }, + ), + returnValue: _i9.Future<_i3.AccessTokenResponse>.value( + _FakeAccessTokenResponse_1( + this, + Invocation.method( + #requestAccessToken, + [], + { + #code: code, + #clientId: clientId, + #clientSecret: clientSecret, + #codeVerifier: codeVerifier, + #scopes: scopes, + #customParams: customParams, + #customHeaders: customHeaders, + #httpClient: httpClient, + }, + ), + )), + ) as _i9.Future<_i3.AccessTokenResponse>); + @override + _i9.Future<_i3.AccessTokenResponse> refreshToken( + String? refreshToken, { + dynamic httpClient, + required String? clientId, + String? clientSecret, + List? scopes, + }) => (super.noSuchMethod( - Invocation.method(#refreshToken, [ - refreshToken - ], { + Invocation.method( + #refreshToken, + [refreshToken], + { #httpClient: httpClient, #clientId: clientId, #clientSecret: clientSecret, - #scopes: scopes - }), - returnValue: _i9.Future<_i3.AccessTokenResponse>.value( - _FakeAccessTokenResponse_1( - this, - Invocation.method(#refreshToken, [ - refreshToken - ], { - #httpClient: httpClient, - #clientId: clientId, - #clientSecret: clientSecret, - #scopes: scopes - })))) as _i9.Future<_i3.AccessTokenResponse>); - @override - _i9.Future<_i5.OAuth2Response> revokeToken(_i3.AccessTokenResponse? tknResp, - {String? clientId, String? clientSecret, dynamic httpClient}) => - (super.noSuchMethod(Invocation.method(#revokeToken, [tknResp], {#clientId: clientId, #clientSecret: clientSecret, #httpClient: httpClient}), - returnValue: _i9.Future<_i5.OAuth2Response>.value(_FakeOAuth2Response_3( - this, - Invocation.method(#revokeToken, [ - tknResp - ], { - #clientId: clientId, - #clientSecret: clientSecret, - #httpClient: httpClient - })))) as _i9.Future<_i5.OAuth2Response>); - @override - _i9.Future<_i5.OAuth2Response> revokeAccessToken(_i3.AccessTokenResponse? tknResp, - {String? clientId, String? clientSecret, dynamic httpClient}) => - (super.noSuchMethod(Invocation.method(#revokeAccessToken, [tknResp], {#clientId: clientId, #clientSecret: clientSecret, #httpClient: httpClient}), - returnValue: _i9.Future<_i5.OAuth2Response>.value(_FakeOAuth2Response_3( - this, - Invocation.method(#revokeAccessToken, [ - tknResp - ], { - #clientId: clientId, - #clientSecret: clientSecret, - #httpClient: httpClient - })))) as _i9.Future<_i5.OAuth2Response>); - @override - _i9.Future<_i5.OAuth2Response> revokeRefreshToken(_i3.AccessTokenResponse? tknResp, - {String? clientId, String? clientSecret, dynamic httpClient}) => - (super.noSuchMethod(Invocation.method(#revokeRefreshToken, [tknResp], {#clientId: clientId, #clientSecret: clientSecret, #httpClient: httpClient}), - returnValue: _i9.Future<_i5.OAuth2Response>.value(_FakeOAuth2Response_3( - this, - Invocation.method(#revokeRefreshToken, [ - tknResp - ], { - #clientId: clientId, - #clientSecret: clientSecret, - #httpClient: httpClient - })))) as _i9.Future<_i5.OAuth2Response>); - @override - String getAuthorizeUrl( - {String? clientId, - String? responseType = r'code', - String? redirectUri, - List? scopes, - bool? enableState = true, - String? state, - String? codeChallenge, - Map? customParams}) => + #scopes: scopes, + }, + ), + returnValue: _i9.Future<_i3.AccessTokenResponse>.value( + _FakeAccessTokenResponse_1( + this, + Invocation.method( + #refreshToken, + [refreshToken], + { + #httpClient: httpClient, + #clientId: clientId, + #clientSecret: clientSecret, + #scopes: scopes, + }, + ), + )), + ) as _i9.Future<_i3.AccessTokenResponse>); + @override + _i9.Future<_i5.OAuth2Response> revokeToken( + _i3.AccessTokenResponse? tknResp, { + String? clientId, + String? clientSecret, + dynamic httpClient, + }) => (super.noSuchMethod( - Invocation.method(#getAuthorizeUrl, [], { + Invocation.method( + #revokeToken, + [tknResp], + { + #clientId: clientId, + #clientSecret: clientSecret, + #httpClient: httpClient, + }, + ), + returnValue: _i9.Future<_i5.OAuth2Response>.value(_FakeOAuth2Response_3( + this, + Invocation.method( + #revokeToken, + [tknResp], + { + #clientId: clientId, + #clientSecret: clientSecret, + #httpClient: httpClient, + }, + ), + )), + ) as _i9.Future<_i5.OAuth2Response>); + @override + _i9.Future<_i5.OAuth2Response> revokeAccessToken( + _i3.AccessTokenResponse? tknResp, { + String? clientId, + String? clientSecret, + dynamic httpClient, + }) => + (super.noSuchMethod( + Invocation.method( + #revokeAccessToken, + [tknResp], + { + #clientId: clientId, + #clientSecret: clientSecret, + #httpClient: httpClient, + }, + ), + returnValue: _i9.Future<_i5.OAuth2Response>.value(_FakeOAuth2Response_3( + this, + Invocation.method( + #revokeAccessToken, + [tknResp], + { + #clientId: clientId, + #clientSecret: clientSecret, + #httpClient: httpClient, + }, + ), + )), + ) as _i9.Future<_i5.OAuth2Response>); + @override + _i9.Future<_i5.OAuth2Response> revokeRefreshToken( + _i3.AccessTokenResponse? tknResp, { + String? clientId, + String? clientSecret, + dynamic httpClient, + }) => + (super.noSuchMethod( + Invocation.method( + #revokeRefreshToken, + [tknResp], + { + #clientId: clientId, + #clientSecret: clientSecret, + #httpClient: httpClient, + }, + ), + returnValue: _i9.Future<_i5.OAuth2Response>.value(_FakeOAuth2Response_3( + this, + Invocation.method( + #revokeRefreshToken, + [tknResp], + { + #clientId: clientId, + #clientSecret: clientSecret, + #httpClient: httpClient, + }, + ), + )), + ) as _i9.Future<_i5.OAuth2Response>); + @override + String getAuthorizeUrl({ + required String? clientId, + String? responseType = r'code', + String? redirectUri, + List? scopes, + bool? enableState = true, + String? state, + String? codeChallenge, + Map? customParams, + }) => + (super.noSuchMethod( + Invocation.method( + #getAuthorizeUrl, + [], + { #clientId: clientId, #responseType: responseType, #redirectUri: redirectUri, @@ -405,53 +602,85 @@ class MockOAuth2Client extends _i1.Mock implements _i8.OAuth2Client { #enableState: enableState, #state: state, #codeChallenge: codeChallenge, - #customParams: customParams - }), - returnValue: '') as String); - @override - Map getTokenUrlParams( - {String? code, - String? redirectUri, - String? codeVerifier, - Map? customParams}) => + #customParams: customParams, + }, + ), + returnValue: '', + ) as String); + @override + Map getTokenUrlParams({ + required String? code, + String? redirectUri, + String? codeVerifier, + Map? customParams, + }) => (super.noSuchMethod( - Invocation.method(#getTokenUrlParams, [], { + Invocation.method( + #getTokenUrlParams, + [], + { #code: code, #redirectUri: redirectUri, #codeVerifier: codeVerifier, - #customParams: customParams - }), - returnValue: {}) as Map); + #customParams: customParams, + }, + ), + returnValue: {}, + ) as Map); @override - Map getAuthorizationHeader( - {String? clientId, String? clientSecret}) => + Map getAuthorizationHeader({ + required String? clientId, + String? clientSecret, + }) => (super.noSuchMethod( - Invocation.method(#getAuthorizationHeader, [], - {#clientId: clientId, #clientSecret: clientSecret}), - returnValue: {}) as Map); + Invocation.method( + #getAuthorizationHeader, + [], + { + #clientId: clientId, + #clientSecret: clientSecret, + }, + ), + returnValue: {}, + ) as Map); @override - Map getRefreshUrlParams({String? refreshToken}) => + Map getRefreshUrlParams({required String? refreshToken}) => (super.noSuchMethod( - Invocation.method( - #getRefreshUrlParams, [], {#refreshToken: refreshToken}), - returnValue: {}) as Map); + Invocation.method( + #getRefreshUrlParams, + [], + {#refreshToken: refreshToken}, + ), + returnValue: {}, + ) as Map); @override - _i3.AccessTokenResponse http2TokenResponse(_i6.Response? response, - {List? requestedScopes}) => + _i3.AccessTokenResponse http2TokenResponse( + _i6.Response? response, { + List? requestedScopes, + }) => (super.noSuchMethod( - Invocation.method(#http2TokenResponse, [response], - {#requestedScopes: requestedScopes}), - returnValue: _FakeAccessTokenResponse_1( - this, - Invocation.method(#http2TokenResponse, [ - response - ], { - #requestedScopes: requestedScopes - }))) as _i3.AccessTokenResponse); - @override - String serializeScopes(List? scopes) => - (super.noSuchMethod(Invocation.method(#serializeScopes, [scopes]), - returnValue: '') as String); + Invocation.method( + #http2TokenResponse, + [response], + {#requestedScopes: requestedScopes}, + ), + returnValue: _FakeAccessTokenResponse_1( + this, + Invocation.method( + #http2TokenResponse, + [response], + {#requestedScopes: requestedScopes}, + ), + ), + ) as _i3.AccessTokenResponse); + @override + String serializeScopes(List? scopes) => (super.noSuchMethod( + Invocation.method( + #serializeScopes, + [scopes], + ), + returnValue: '', + ) as String); } /// A class which mocks [Client]. @@ -463,102 +692,215 @@ class MockClient extends _i1.Mock implements _i6.Client { } @override - _i9.Future<_i6.Response> head(Uri? url, {Map? headers}) => - (super.noSuchMethod(Invocation.method(#head, [url], {#headers: headers}), - returnValue: _i9.Future<_i6.Response>.value(_FakeResponse_4( - this, Invocation.method(#head, [url], {#headers: headers})))) - as _i9.Future<_i6.Response>); - @override - _i9.Future<_i6.Response> get(Uri? url, {Map? headers}) => - (super.noSuchMethod(Invocation.method(#get, [url], {#headers: headers}), - returnValue: _i9.Future<_i6.Response>.value(_FakeResponse_4( - this, Invocation.method(#get, [url], {#headers: headers})))) - as _i9.Future<_i6.Response>); - @override - _i9.Future<_i6.Response> post(Uri? url, - {Map? headers, - Object? body, - _i10.Encoding? encoding}) => - (super - .noSuchMethod(Invocation.method(#post, [url], {#headers: headers, #body: body, #encoding: encoding}), - returnValue: _i9.Future<_i6.Response>.value(_FakeResponse_4( - this, - Invocation.method(#post, [ - url - ], { - #headers: headers, - #body: body, - #encoding: encoding - })))) as _i9.Future<_i6.Response>); - @override - _i9.Future<_i6.Response> put(Uri? url, - {Map? headers, - Object? body, - _i10.Encoding? encoding}) => - (super - .noSuchMethod(Invocation.method(#put, [url], {#headers: headers, #body: body, #encoding: encoding}), - returnValue: _i9.Future<_i6.Response>.value(_FakeResponse_4( - this, - Invocation.method(#put, [ - url - ], { - #headers: headers, - #body: body, - #encoding: encoding - })))) as _i9.Future<_i6.Response>); - @override - _i9.Future<_i6.Response> patch(Uri? url, - {Map? headers, - Object? body, - _i10.Encoding? encoding}) => - (super - .noSuchMethod(Invocation.method(#patch, [url], {#headers: headers, #body: body, #encoding: encoding}), - returnValue: _i9.Future<_i6.Response>.value(_FakeResponse_4( - this, - Invocation.method(#patch, [ - url - ], { - #headers: headers, - #body: body, - #encoding: encoding - })))) as _i9.Future<_i6.Response>); - @override - _i9.Future<_i6.Response> delete(Uri? url, - {Map? headers, - Object? body, - _i10.Encoding? encoding}) => - (super - .noSuchMethod(Invocation.method(#delete, [url], {#headers: headers, #body: body, #encoding: encoding}), - returnValue: _i9.Future<_i6.Response>.value(_FakeResponse_4( - this, - Invocation.method(#delete, [ - url - ], { - #headers: headers, - #body: body, - #encoding: encoding - })))) as _i9.Future<_i6.Response>); - @override - _i9.Future read(Uri? url, {Map? headers}) => - (super.noSuchMethod(Invocation.method(#read, [url], {#headers: headers}), - returnValue: _i9.Future.value('')) as _i9.Future); - @override - _i9.Future<_i11.Uint8List> readBytes(Uri? url, - {Map? headers}) => + _i9.Future<_i6.Response> head( + Uri? url, { + Map? headers, + }) => + (super.noSuchMethod( + Invocation.method( + #head, + [url], + {#headers: headers}, + ), + returnValue: _i9.Future<_i6.Response>.value(_FakeResponse_4( + this, + Invocation.method( + #head, + [url], + {#headers: headers}, + ), + )), + ) as _i9.Future<_i6.Response>); + @override + _i9.Future<_i6.Response> get( + Uri? url, { + Map? headers, + }) => + (super.noSuchMethod( + Invocation.method( + #get, + [url], + {#headers: headers}, + ), + returnValue: _i9.Future<_i6.Response>.value(_FakeResponse_4( + this, + Invocation.method( + #get, + [url], + {#headers: headers}, + ), + )), + ) as _i9.Future<_i6.Response>); + @override + _i9.Future<_i6.Response> post( + Uri? url, { + Map? headers, + Object? body, + _i10.Encoding? encoding, + }) => + (super.noSuchMethod( + Invocation.method( + #post, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + returnValue: _i9.Future<_i6.Response>.value(_FakeResponse_4( + this, + Invocation.method( + #post, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + )), + ) as _i9.Future<_i6.Response>); + @override + _i9.Future<_i6.Response> put( + Uri? url, { + Map? headers, + Object? body, + _i10.Encoding? encoding, + }) => + (super.noSuchMethod( + Invocation.method( + #put, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + returnValue: _i9.Future<_i6.Response>.value(_FakeResponse_4( + this, + Invocation.method( + #put, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + )), + ) as _i9.Future<_i6.Response>); + @override + _i9.Future<_i6.Response> patch( + Uri? url, { + Map? headers, + Object? body, + _i10.Encoding? encoding, + }) => + (super.noSuchMethod( + Invocation.method( + #patch, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + returnValue: _i9.Future<_i6.Response>.value(_FakeResponse_4( + this, + Invocation.method( + #patch, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + )), + ) as _i9.Future<_i6.Response>); + @override + _i9.Future<_i6.Response> delete( + Uri? url, { + Map? headers, + Object? body, + _i10.Encoding? encoding, + }) => + (super.noSuchMethod( + Invocation.method( + #delete, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + returnValue: _i9.Future<_i6.Response>.value(_FakeResponse_4( + this, + Invocation.method( + #delete, + [url], + { + #headers: headers, + #body: body, + #encoding: encoding, + }, + ), + )), + ) as _i9.Future<_i6.Response>); + @override + _i9.Future read( + Uri? url, { + Map? headers, + }) => (super.noSuchMethod( - Invocation.method(#readBytes, [url], {#headers: headers}), - returnValue: _i9.Future<_i11.Uint8List>.value(_i11.Uint8List(0))) - as _i9.Future<_i11.Uint8List>); + Invocation.method( + #read, + [url], + {#headers: headers}, + ), + returnValue: _i9.Future.value(''), + ) as _i9.Future); + @override + _i9.Future<_i11.Uint8List> readBytes( + Uri? url, { + Map? headers, + }) => + (super.noSuchMethod( + Invocation.method( + #readBytes, + [url], + {#headers: headers}, + ), + returnValue: _i9.Future<_i11.Uint8List>.value(_i11.Uint8List(0)), + ) as _i9.Future<_i11.Uint8List>); @override _i9.Future<_i6.StreamedResponse> send(_i6.BaseRequest? request) => - (super.noSuchMethod(Invocation.method(#send, [request]), - returnValue: _i9.Future<_i6.StreamedResponse>.value( - _FakeStreamedResponse_5( - this, Invocation.method(#send, [request])))) - as _i9.Future<_i6.StreamedResponse>); - @override - void close() => super.noSuchMethod(Invocation.method(#close, []), - returnValueForMissingStub: null); + (super.noSuchMethod( + Invocation.method( + #send, + [request], + ), + returnValue: + _i9.Future<_i6.StreamedResponse>.value(_FakeStreamedResponse_5( + this, + Invocation.method( + #send, + [request], + ), + )), + ) as _i9.Future<_i6.StreamedResponse>); + @override + void close() => super.noSuchMethod( + Invocation.method( + #close, + [], + ), + returnValueForMissingStub: null, + ); } /// A class which mocks [TokenStorage]. @@ -570,58 +912,104 @@ class MockTokenStorage extends _i1.Mock implements _i12.TokenStorage { } @override - String get key => - (super.noSuchMethod(Invocation.getter(#key), returnValue: '') as String); + String get key => (super.noSuchMethod( + Invocation.getter(#key), + returnValue: '', + ) as String); @override - set key(String? _key) => super.noSuchMethod(Invocation.setter(#key, _key), - returnValueForMissingStub: null); + set key(String? _key) => super.noSuchMethod( + Invocation.setter( + #key, + _key, + ), + returnValueForMissingStub: null, + ); @override _i7.BaseStorage get storage => (super.noSuchMethod( + Invocation.getter(#storage), + returnValue: _FakeBaseStorage_6( + this, Invocation.getter(#storage), - returnValue: _FakeBaseStorage_6(this, Invocation.getter(#storage))) - as _i7.BaseStorage); + ), + ) as _i7.BaseStorage); @override - set storage(_i7.BaseStorage? _storage) => - super.noSuchMethod(Invocation.setter(#storage, _storage), - returnValueForMissingStub: null); + set storage(_i7.BaseStorage? _storage) => super.noSuchMethod( + Invocation.setter( + #storage, + _storage, + ), + returnValueForMissingStub: null, + ); @override _i9.Future<_i3.AccessTokenResponse?> getToken(List? scopes) => - (super.noSuchMethod(Invocation.method(#getToken, [scopes]), - returnValue: _i9.Future<_i3.AccessTokenResponse?>.value()) - as _i9.Future<_i3.AccessTokenResponse?>); + (super.noSuchMethod( + Invocation.method( + #getToken, + [scopes], + ), + returnValue: _i9.Future<_i3.AccessTokenResponse?>.value(), + ) as _i9.Future<_i3.AccessTokenResponse?>); @override _i9.Future addToken(_i3.AccessTokenResponse? tknResp) => - (super.noSuchMethod(Invocation.method(#addToken, [tknResp]), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value()) - as _i9.Future); + (super.noSuchMethod( + Invocation.method( + #addToken, + [tknResp], + ), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override _i9.Future>> insertToken( _i3.AccessTokenResponse? tknResp) => - (super.noSuchMethod(Invocation.method(#insertToken, [tknResp]), - returnValue: _i9.Future>>.value( - >{})) - as _i9.Future>>); - @override - _i9.Future deleteToken(List? scopes) => - (super.noSuchMethod(Invocation.method(#deleteToken, [scopes]), - returnValue: _i9.Future.value(false)) as _i9.Future); - @override - _i9.Future deleteAllTokens() => - (super.noSuchMethod(Invocation.method(#deleteAllTokens, []), - returnValue: _i9.Future.value(false)) as _i9.Future); - @override - List clearScopes(List? scopes) => - (super.noSuchMethod(Invocation.method(#clearScopes, [scopes]), - returnValue: []) as List); - @override - List getSortedScopes(List? scopes) => - (super.noSuchMethod(Invocation.method(#getSortedScopes, [scopes]), - returnValue: []) as List); - @override - String getScopeKey(List? scope) => - (super.noSuchMethod(Invocation.method(#getScopeKey, [scope]), - returnValue: '') as String); + (super.noSuchMethod( + Invocation.method( + #insertToken, + [tknResp], + ), + returnValue: _i9.Future>>.value( + >{}), + ) as _i9.Future>>); + @override + _i9.Future deleteToken(List? scopes) => (super.noSuchMethod( + Invocation.method( + #deleteToken, + [scopes], + ), + returnValue: _i9.Future.value(false), + ) as _i9.Future); + @override + _i9.Future deleteAllTokens() => (super.noSuchMethod( + Invocation.method( + #deleteAllTokens, + [], + ), + returnValue: _i9.Future.value(false), + ) as _i9.Future); + @override + List clearScopes(List? scopes) => (super.noSuchMethod( + Invocation.method( + #clearScopes, + [scopes], + ), + returnValue: [], + ) as List); + @override + List getSortedScopes(List? scopes) => (super.noSuchMethod( + Invocation.method( + #getSortedScopes, + [scopes], + ), + returnValue: [], + ) as List); + @override + String getScopeKey(List? scope) => (super.noSuchMethod( + Invocation.method( + #getScopeKey, + [scope], + ), + returnValue: '', + ) as String); } /// A class which mocks [BaseStorage]. @@ -633,12 +1021,27 @@ class MockBaseStorage extends _i1.Mock implements _i7.BaseStorage { } @override - _i9.Future read(String? key) => - (super.noSuchMethod(Invocation.method(#read, [key]), - returnValue: _i9.Future.value()) as _i9.Future); + _i9.Future read(String? key) => (super.noSuchMethod( + Invocation.method( + #read, + [key], + ), + returnValue: _i9.Future.value(), + ) as _i9.Future); @override - _i9.Future write(String? key, String? value) => (super.noSuchMethod( - Invocation.method(#write, [key, value]), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value()) as _i9.Future); + _i9.Future write( + String? key, + String? value, + ) => + (super.noSuchMethod( + Invocation.method( + #write, + [ + key, + value, + ], + ), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); } diff --git a/test/token_storage_test.mocks.dart b/test/token_storage_test.mocks.dart index 2942cb1..956dfd1 100644 --- a/test/token_storage_test.mocks.dart +++ b/test/token_storage_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.3.0 from annotations +// Mocks generated by Mockito 5.4.2 from annotations // in oauth2_client/test/token_storage_test.dart. // Do not manually edit this file. @@ -28,12 +28,27 @@ class MockSecureStorage extends _i1.Mock implements _i2.SecureStorage { } @override - _i3.Future read(String? key) => - (super.noSuchMethod(Invocation.method(#read, [key]), - returnValue: _i3.Future.value()) as _i3.Future); + _i3.Future read(String? key) => (super.noSuchMethod( + Invocation.method( + #read, + [key], + ), + returnValue: _i3.Future.value(), + ) as _i3.Future); @override - _i3.Future write(String? key, String? value) => (super.noSuchMethod( - Invocation.method(#write, [key, value]), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value()) as _i3.Future); + _i3.Future write( + String? key, + String? value, + ) => + (super.noSuchMethod( + Invocation.method( + #write, + [ + key, + value, + ], + ), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); }