mirror of https://github.com/grpc/grpc-dart.git
Bump mockito to breaking change with fixes (#450)
This commit is contained in:
parent
eedc9acdc8
commit
7e8952c352
|
@ -22,7 +22,7 @@ dependencies:
|
|||
dev_dependencies:
|
||||
build_runner: ^1.11.0
|
||||
build_test: ^1.3.4
|
||||
mockito: ^5.0.0-nullsafety.5
|
||||
mockito: ^5.0.0-nullsafety.6
|
||||
path: ^1.8.0-nullsafety.3
|
||||
test: ^1.16.0-nullsafety.16
|
||||
stream_channel: ^2.1.0-nullsafety.3
|
||||
|
|
|
@ -54,11 +54,13 @@ class MockHttpRequest extends Mock implements HttpRequest {
|
|||
final int status;
|
||||
|
||||
@override
|
||||
int get readyState => super.noSuchMethod(Invocation.getter(#readyState), -1);
|
||||
int get readyState =>
|
||||
super.noSuchMethod(Invocation.getter(#readyState), returnValue: -1);
|
||||
|
||||
@override
|
||||
Map<String, String> get responseHeaders => super
|
||||
.noSuchMethod(Invocation.getter(#responseHeaders), <String, String>{});
|
||||
Map<String, String> get responseHeaders =>
|
||||
super.noSuchMethod(Invocation.getter(#responseHeaders),
|
||||
returnValue: <String, String>{});
|
||||
}
|
||||
|
||||
class MockXhrClientConnection extends XhrClientConnection {
|
||||
|
|
|
@ -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 '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;
|
||||
|
||||
// ignore_for_file: comment_references
|
||||
|
||||
// ignore_for_file: unnecessary_parenthesis
|
||||
|
||||
class _FakeClientTransportStream extends _i1.Fake
|
||||
|
@ -24,32 +27,35 @@ class MockClientTransportConnection extends _i1.Mock
|
|||
|
||||
@override
|
||||
bool get isOpen =>
|
||||
(super.noSuchMethod(Invocation.getter(#isOpen), false) as bool);
|
||||
(super.noSuchMethod(Invocation.getter(#isOpen), returnValue: false)
|
||||
as bool);
|
||||
@override
|
||||
set onActiveStateChanged(_i2.ActiveStateHandler? callback) =>
|
||||
super.noSuchMethod(Invocation.setter(#onActiveStateChanged, callback));
|
||||
super.noSuchMethod(Invocation.setter(#onActiveStateChanged, callback),
|
||||
returnValueForMissingStub: null);
|
||||
@override
|
||||
_i3.Future<void> get onInitialPeerSettingsReceived => (super.noSuchMethod(
|
||||
Invocation.getter(#onInitialPeerSettingsReceived), Future.value(null))
|
||||
as _i3.Future<void>);
|
||||
_i3.Future<void> get onInitialPeerSettingsReceived =>
|
||||
(super.noSuchMethod(Invocation.getter(#onInitialPeerSettingsReceived),
|
||||
returnValue: Future.value(null)) as _i3.Future<void>);
|
||||
@override
|
||||
_i2.ClientTransportStream makeRequest(List<_i4.Header>? headers,
|
||||
{bool? endStream = false}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#makeRequest, [headers], {#endStream: endStream}),
|
||||
_FakeClientTransportStream()) as _i2.ClientTransportStream);
|
||||
returnValue:
|
||||
_FakeClientTransportStream()) as _i2.ClientTransportStream);
|
||||
@override
|
||||
_i3.Future<dynamic> ping() =>
|
||||
(super.noSuchMethod(Invocation.method(#ping, []), Future.value(null))
|
||||
as _i3.Future<dynamic>);
|
||||
(super.noSuchMethod(Invocation.method(#ping, []),
|
||||
returnValue: Future.value(null)) as _i3.Future<dynamic>);
|
||||
@override
|
||||
_i3.Future<dynamic> finish() =>
|
||||
(super.noSuchMethod(Invocation.method(#finish, []), Future.value(null))
|
||||
as _i3.Future<dynamic>);
|
||||
(super.noSuchMethod(Invocation.method(#finish, []),
|
||||
returnValue: Future.value(null)) as _i3.Future<dynamic>);
|
||||
@override
|
||||
_i3.Future<dynamic> terminate() =>
|
||||
(super.noSuchMethod(Invocation.method(#terminate, []), Future.value(null))
|
||||
as _i3.Future<dynamic>);
|
||||
(super.noSuchMethod(Invocation.method(#terminate, []),
|
||||
returnValue: Future.value(null)) as _i3.Future<dynamic>);
|
||||
}
|
||||
|
||||
/// A class which mocks [ClientTransportStream].
|
||||
|
@ -62,30 +68,35 @@ class MockClientTransportStream extends _i1.Mock
|
|||
}
|
||||
|
||||
@override
|
||||
_i3.Stream<_i2.TransportStreamPush> get peerPushes => (super.noSuchMethod(
|
||||
Invocation.getter(#peerPushes),
|
||||
Stream<_i2.TransportStreamPush>.empty())
|
||||
as _i3.Stream<_i2.TransportStreamPush>);
|
||||
_i3.Stream<_i2.TransportStreamPush> get peerPushes =>
|
||||
(super.noSuchMethod(Invocation.getter(#peerPushes),
|
||||
returnValue: Stream<_i2.TransportStreamPush>.empty())
|
||||
as _i3.Stream<_i2.TransportStreamPush>);
|
||||
@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
|
||||
_i3.Stream<_i2.StreamMessage> get incomingMessages => (super.noSuchMethod(
|
||||
Invocation.getter(#incomingMessages),
|
||||
Stream<_i2.StreamMessage>.empty()) as _i3.Stream<_i2.StreamMessage>);
|
||||
_i3.Stream<_i2.StreamMessage> get incomingMessages =>
|
||||
(super.noSuchMethod(Invocation.getter(#incomingMessages),
|
||||
returnValue: Stream<_i2.StreamMessage>.empty())
|
||||
as _i3.Stream<_i2.StreamMessage>);
|
||||
@override
|
||||
_i3.StreamSink<_i2.StreamMessage> get outgoingMessages => (super.noSuchMethod(
|
||||
Invocation.getter(#outgoingMessages),
|
||||
_FakeStreamSink<_i2.StreamMessage>())
|
||||
as _i3.StreamSink<_i2.StreamMessage>);
|
||||
_i3.StreamSink<_i2.StreamMessage> get outgoingMessages =>
|
||||
(super.noSuchMethod(Invocation.getter(#outgoingMessages),
|
||||
returnValue: _FakeStreamSink<_i2.StreamMessage>())
|
||||
as _i3.StreamSink<_i2.StreamMessage>);
|
||||
@override
|
||||
set onTerminated(void Function(int?)? value) =>
|
||||
super.noSuchMethod(Invocation.setter(#onTerminated, value));
|
||||
super.noSuchMethod(Invocation.setter(#onTerminated, value),
|
||||
returnValueForMissingStub: null);
|
||||
@override
|
||||
void sendHeaders(List<_i4.Header>? headers, {bool? endStream = false}) =>
|
||||
super.noSuchMethod(
|
||||
Invocation.method(#sendHeaders, [headers], {#endStream: endStream}));
|
||||
Invocation.method(#sendHeaders, [headers], {#endStream: endStream}),
|
||||
returnValueForMissingStub: null);
|
||||
@override
|
||||
void sendData(List<int>? bytes, {bool? endStream = false}) =>
|
||||
super.noSuchMethod(
|
||||
Invocation.method(#sendData, [bytes], {#endStream: endStream}));
|
||||
Invocation.method(#sendData, [bytes], {#endStream: endStream}),
|
||||
returnValueForMissingStub: null);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue