Unverified Commit e59651f9 authored by Alexander Aprelev's avatar Alexander Aprelev Committed by GitHub

Revert "Move mockito to 3.0.0-alpha. (#15949)" (#15979)

This reverts commit a7e62258 as there are failing tests.
parent a7e62258
......@@ -21,7 +21,7 @@ dependencies:
dev_dependencies:
test: 0.12.32+2
mockito: 3.0.0-alpha+2
mockito: 2.2.3
barback: 0.15.2+15 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
boolean_selector: 1.0.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
......
......@@ -13,7 +13,7 @@ dev_dependencies:
flutter_test:
sdk: flutter
mockito: 3.0.0-alpha+2
mockito: 2.2.3
args: 1.4.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
async: 2.0.6 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
......
......@@ -11,9 +11,9 @@ MockHttpClient createMockImageHttpClient(SecurityContext _) {
final MockHttpClientRequest request = new MockHttpClientRequest();
final MockHttpClientResponse response = new MockHttpClientResponse();
final MockHttpHeaders headers = new MockHttpHeaders();
when(client.getUrl(typed(any))).thenAnswer((_) => new Future<HttpClientRequest>.value(request));
when(client.getUrl(typed(any))).thenReturn(new Future<HttpClientRequest>.value(request));
when(request.headers).thenReturn(headers);
when(request.close()).thenAnswer((_) => new Future<HttpClientResponse>.value(response));
when(request.close()).thenReturn(new Future<HttpClientResponse>.value(response));
when(response.contentLength).thenReturn(kTransparentImage.length);
when(response.statusCode).thenReturn(HttpStatus.OK);
when(response.listen(typed(any))).thenAnswer((Invocation invocation) {
......
......@@ -24,7 +24,7 @@ dependencies:
dev_dependencies:
test: 0.12.32+2
mockito: 3.0.0-alpha+2
mockito: 2.2.3
barback: 0.15.2+15 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
boolean_selector: 1.0.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
......
......@@ -16,7 +16,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
mockito: 3.0.0-alpha+2
mockito: 2.2.3
args: 1.4.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
async: 2.0.6 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
......
......@@ -59,7 +59,7 @@ void main() {
}
return refreshIndicator;
});
when(mockHelper.refreshTask()).thenAnswer((_) => refreshCompleter.future);
when(mockHelper.refreshTask()).thenReturn(refreshCompleter.future);
});
SliverList buildAListOfStuff() {
......
......@@ -27,9 +27,9 @@ void main() {
verify(headers.add('flutter', 'flutter')).called(1);
}, createHttpClient: (SecurityContext _) {
when(client.getUrl(typed(any))).thenAnswer((_) => new Future<HttpClientRequest>.value(request));
when(client.getUrl(typed(any))).thenReturn(new Future<HttpClientRequest>.value(request));
when(request.headers).thenReturn(headers);
when(request.close()).thenAnswer((_) => new Future<HttpClientResponse>.value(response));
when(request.close()).thenReturn(new Future<HttpClientResponse>.value(response));
when(response.contentLength).thenReturn(kTransparentImage.length);
when(response.statusCode).thenReturn(HttpStatus.OK);
when(response.listen(typed(any))).thenAnswer((Invocation invocation) {
......
......@@ -66,7 +66,7 @@ dependencies:
dev_dependencies:
test: 0.12.32+2
mockito: 3.0.0-alpha+2
mockito: 2.2.3
quiver: 0.28.0
# PUBSPEC CHECKSUM: 74e9
......@@ -15,7 +15,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
mockito: 3.0.0-alpha+2
mockito: 2.2.3
args: 1.4.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
async: 2.0.6 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
......
......@@ -81,7 +81,7 @@ dependencies:
dev_dependencies:
collection: 1.14.6
mockito: 3.0.0-alpha+2
mockito: 2.2.3
dartdoc:
# Exclude this package from the hosted API docs.
......
......@@ -46,14 +46,14 @@ void main() {
]);
final Process process = new MockProcess();
when(process.stdout).thenAnswer((_) => stdout);
when(process.stderr).thenAnswer((_) => const Stream<List<int>>.empty());
when(process.exitCode).thenAnswer((_) => new Future<int>.value(0));
when(process.stdout).thenReturn(stdout);
when(process.stderr).thenReturn(const Stream<List<int>>.empty());
when(process.exitCode).thenReturn(new Future<int>.value(0));
when(mockProcessManager.start(
<String>['git', 'branch', '-r'],
workingDirectory: typed(any, named: 'workingDirectory'),
environment: typed(any, named: 'environment')))
.thenAnswer((_) => new Future<Process>.value(process));
.thenReturn(new Future<Process>.value(process));
final ChannelCommand command = new ChannelCommand();
final CommandRunner<Null> runner = createTestCommandRunner(command);
......
......@@ -30,7 +30,7 @@ void main() {
when(mockFrontendServer.stderr)
.thenAnswer((Invocation invocation) => mockFrontendServerStdErr);
final StreamController<String> stdErrStreamController = new StreamController<String>();
when(mockFrontendServerStdErr.transform<String>(any)).thenAnswer((_) => stdErrStreamController.stream);
when(mockFrontendServerStdErr.transform<String>(any)).thenReturn(stdErrStreamController.stream);
when(mockFrontendServer.stdin).thenReturn(mockFrontendServerStdIn);
when(mockProcessManager.canRun(any)).thenReturn(true);
when(mockProcessManager.start(any)).thenAnswer(
......
......@@ -62,7 +62,7 @@ dependencies:
yaml: 2.1.13 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
dev_dependencies:
mockito: 3.0.0-alpha+2
mockito: 2.2.3
test: 0.12.32+2
# PUBSPEC CHECKSUM: 97d6
......@@ -100,7 +100,7 @@ void main() {
mockPeerConnections.add(mp);
uriConnections.add(uri);
when(mp.sendRequest(typed<String>(any), typed<String>(any)))
.thenAnswer((_) => new Future<Map<String, dynamic>>(
.thenReturn(new Future<Map<String, dynamic>>(
() => flutterViewCannedResponses[flutterViewIndex++]));
return mp;
});
......
......@@ -86,7 +86,7 @@ void main() {
Future<json_rpc.Peer> mockVmConnectionFunction(Uri uri) {
when(mockPeer.sendRequest(
typed<String>(any), typed<Map<String, dynamic>>(any)))
.thenAnswer((_) => new Future<Map<String, dynamic>>(
.thenReturn(new Future<Map<String, dynamic>>(
() => flutterViewCannedResponses));
return new Future<json_rpc.Peer>(() => mockPeer);
}
......@@ -135,7 +135,7 @@ void main() {
Future<json_rpc.Peer> mockVmConnectionFunction(Uri uri) {
when(mockPeer.sendRequest(
typed<String>(any), typed<Map<String, dynamic>>(any)))
.thenAnswer((_) => new Future<Map<String, dynamic>>(
.thenReturn(new Future<Map<String, dynamic>>(
() => flutterViewCannedResponseMissingId));
return new Future<json_rpc.Peer>(() => mockPeer);
}
......@@ -173,7 +173,7 @@ void main() {
Future<json_rpc.Peer> mockVmConnectionFunction(Uri uri) {
when(mockPeer.sendRequest(
typed<String>(any), typed<Map<String, dynamic>>(any)))
.thenAnswer((_) => new Future<Map<String, dynamic>>(
.thenReturn(new Future<Map<String, dynamic>>(
() => flutterViewCannedResponseMissingIsolateName));
return new Future<json_rpc.Peer>(() => mockPeer);
}
......@@ -208,7 +208,7 @@ void main() {
// Return a command that will never complete.
when(mockPeer.sendRequest(
typed<String>(any), typed<Map<String, dynamic>>(any)))
.thenAnswer((_) => new Completer<Map<String, dynamic>>().future);
.thenReturn(new Completer<Map<String, dynamic>>().future);
return new Future<json_rpc.Peer>(() => mockPeer);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment