Bump mockito to breaking change with fixes (#450)

This commit is contained in:
Sam Rawlins 2021-02-04 00:42:29 -08:00 committed by GitHub
parent eedc9acdc8
commit 7e8952c352
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 45 additions and 32 deletions

View File

@ -22,7 +22,7 @@ dependencies:
dev_dependencies: dev_dependencies:
build_runner: ^1.11.0 build_runner: ^1.11.0
build_test: ^1.3.4 build_test: ^1.3.4
mockito: ^5.0.0-nullsafety.5 mockito: ^5.0.0-nullsafety.6
path: ^1.8.0-nullsafety.3 path: ^1.8.0-nullsafety.3
test: ^1.16.0-nullsafety.16 test: ^1.16.0-nullsafety.16
stream_channel: ^2.1.0-nullsafety.3 stream_channel: ^2.1.0-nullsafety.3

View File

@ -54,11 +54,13 @@ class MockHttpRequest extends Mock implements HttpRequest {
final int status; final int status;
@override @override
int get readyState => super.noSuchMethod(Invocation.getter(#readyState), -1); int get readyState =>
super.noSuchMethod(Invocation.getter(#readyState), returnValue: -1);
@override @override
Map<String, String> get responseHeaders => super Map<String, String> get responseHeaders =>
.noSuchMethod(Invocation.getter(#responseHeaders), <String, String>{}); super.noSuchMethod(Invocation.getter(#responseHeaders),
returnValue: <String, String>{});
} }
class MockXhrClientConnection extends XhrClientConnection { class MockXhrClientConnection extends XhrClientConnection {

View File

@ -1,3 +1,7 @@
// Mocks generated by Mockito 5.0.0-nullsafety.6 from annotations
// in grpc/test/src/client_utils.dart.
// Do not manually edit this file.
import 'dart:async' as _i3; import 'dart:async' as _i3;
import 'package:http2/src/hpack/hpack.dart' as _i4; import 'package:http2/src/hpack/hpack.dart' as _i4;
@ -5,7 +9,6 @@ import 'package:http2/transport.dart' as _i2;
import 'package:mockito/mockito.dart' as _i1; import 'package:mockito/mockito.dart' as _i1;
// ignore_for_file: comment_references // ignore_for_file: comment_references
// ignore_for_file: unnecessary_parenthesis // ignore_for_file: unnecessary_parenthesis
class _FakeClientTransportStream extends _i1.Fake class _FakeClientTransportStream extends _i1.Fake
@ -24,32 +27,35 @@ class MockClientTransportConnection extends _i1.Mock
@override @override
bool get isOpen => bool get isOpen =>
(super.noSuchMethod(Invocation.getter(#isOpen), false) as bool); (super.noSuchMethod(Invocation.getter(#isOpen), returnValue: false)
as bool);
@override @override
set onActiveStateChanged(_i2.ActiveStateHandler? callback) => set onActiveStateChanged(_i2.ActiveStateHandler? callback) =>
super.noSuchMethod(Invocation.setter(#onActiveStateChanged, callback)); super.noSuchMethod(Invocation.setter(#onActiveStateChanged, callback),
returnValueForMissingStub: null);
@override @override
_i3.Future<void> get onInitialPeerSettingsReceived => (super.noSuchMethod( _i3.Future<void> get onInitialPeerSettingsReceived =>
Invocation.getter(#onInitialPeerSettingsReceived), Future.value(null)) (super.noSuchMethod(Invocation.getter(#onInitialPeerSettingsReceived),
as _i3.Future<void>); returnValue: Future.value(null)) as _i3.Future<void>);
@override @override
_i2.ClientTransportStream makeRequest(List<_i4.Header>? headers, _i2.ClientTransportStream makeRequest(List<_i4.Header>? headers,
{bool? endStream = false}) => {bool? endStream = false}) =>
(super.noSuchMethod( (super.noSuchMethod(
Invocation.method(#makeRequest, [headers], {#endStream: endStream}), Invocation.method(#makeRequest, [headers], {#endStream: endStream}),
returnValue:
_FakeClientTransportStream()) as _i2.ClientTransportStream); _FakeClientTransportStream()) as _i2.ClientTransportStream);
@override @override
_i3.Future<dynamic> ping() => _i3.Future<dynamic> ping() =>
(super.noSuchMethod(Invocation.method(#ping, []), Future.value(null)) (super.noSuchMethod(Invocation.method(#ping, []),
as _i3.Future<dynamic>); returnValue: Future.value(null)) as _i3.Future<dynamic>);
@override @override
_i3.Future<dynamic> finish() => _i3.Future<dynamic> finish() =>
(super.noSuchMethod(Invocation.method(#finish, []), Future.value(null)) (super.noSuchMethod(Invocation.method(#finish, []),
as _i3.Future<dynamic>); returnValue: Future.value(null)) as _i3.Future<dynamic>);
@override @override
_i3.Future<dynamic> terminate() => _i3.Future<dynamic> terminate() =>
(super.noSuchMethod(Invocation.method(#terminate, []), Future.value(null)) (super.noSuchMethod(Invocation.method(#terminate, []),
as _i3.Future<dynamic>); returnValue: Future.value(null)) as _i3.Future<dynamic>);
} }
/// A class which mocks [ClientTransportStream]. /// A class which mocks [ClientTransportStream].
@ -62,30 +68,35 @@ class MockClientTransportStream extends _i1.Mock
} }
@override @override
_i3.Stream<_i2.TransportStreamPush> get peerPushes => (super.noSuchMethod( _i3.Stream<_i2.TransportStreamPush> get peerPushes =>
Invocation.getter(#peerPushes), (super.noSuchMethod(Invocation.getter(#peerPushes),
Stream<_i2.TransportStreamPush>.empty()) returnValue: Stream<_i2.TransportStreamPush>.empty())
as _i3.Stream<_i2.TransportStreamPush>); as _i3.Stream<_i2.TransportStreamPush>);
@override @override
int get id => (super.noSuchMethod(Invocation.getter(#id), 0) as int); int get id =>
(super.noSuchMethod(Invocation.getter(#id), returnValue: 0) as int);
@override @override
_i3.Stream<_i2.StreamMessage> get incomingMessages => (super.noSuchMethod( _i3.Stream<_i2.StreamMessage> get incomingMessages =>
Invocation.getter(#incomingMessages), (super.noSuchMethod(Invocation.getter(#incomingMessages),
Stream<_i2.StreamMessage>.empty()) as _i3.Stream<_i2.StreamMessage>); returnValue: Stream<_i2.StreamMessage>.empty())
as _i3.Stream<_i2.StreamMessage>);
@override @override
_i3.StreamSink<_i2.StreamMessage> get outgoingMessages => (super.noSuchMethod( _i3.StreamSink<_i2.StreamMessage> get outgoingMessages =>
Invocation.getter(#outgoingMessages), (super.noSuchMethod(Invocation.getter(#outgoingMessages),
_FakeStreamSink<_i2.StreamMessage>()) returnValue: _FakeStreamSink<_i2.StreamMessage>())
as _i3.StreamSink<_i2.StreamMessage>); as _i3.StreamSink<_i2.StreamMessage>);
@override @override
set onTerminated(void Function(int?)? value) => set onTerminated(void Function(int?)? value) =>
super.noSuchMethod(Invocation.setter(#onTerminated, value)); super.noSuchMethod(Invocation.setter(#onTerminated, value),
returnValueForMissingStub: null);
@override @override
void sendHeaders(List<_i4.Header>? headers, {bool? endStream = false}) => void sendHeaders(List<_i4.Header>? headers, {bool? endStream = false}) =>
super.noSuchMethod( super.noSuchMethod(
Invocation.method(#sendHeaders, [headers], {#endStream: endStream})); Invocation.method(#sendHeaders, [headers], {#endStream: endStream}),
returnValueForMissingStub: null);
@override @override
void sendData(List<int>? bytes, {bool? endStream = false}) => void sendData(List<int>? bytes, {bool? endStream = false}) =>
super.noSuchMethod( super.noSuchMethod(
Invocation.method(#sendData, [bytes], {#endStream: endStream})); Invocation.method(#sendData, [bytes], {#endStream: endStream}),
returnValueForMissingStub: null);
} }