Move mockito to 3.0.0-alpha. (#15949)

* Move mockito to 3.0.0-alpha.

This is needed so it matches mockito version used internally.

* Pick up +2 for the fixes

* Fix whenReturn in fuchsia_remote_debug_protocol

* more thenReturn becomes thenAnswer

* more thenReturn becomes thenAnswer

* more thenReturn becomes thenAnswer
This commit is contained in:
Alexander Aprelev
2018-03-27 10:05:16 -07:00
committed by GitHub
parent 067be92ae8
commit a7e6225820
15 changed files with 23 additions and 23 deletions

View File

@@ -81,7 +81,7 @@ dependencies:
dev_dependencies:
collection: 1.14.6
mockito: 2.2.3
mockito: 3.0.0-alpha+2
dartdoc:
# Exclude this package from the hosted API docs.

View File

@@ -46,14 +46,14 @@ void main() {
]);
final Process process = new MockProcess();
when(process.stdout).thenReturn(stdout);
when(process.stderr).thenReturn(const Stream<List<int>>.empty());
when(process.exitCode).thenReturn(new Future<int>.value(0));
when(process.stdout).thenAnswer((_) => stdout);
when(process.stderr).thenAnswer((_) => const Stream<List<int>>.empty());
when(process.exitCode).thenAnswer((_) => new Future<int>.value(0));
when(mockProcessManager.start(
<String>['git', 'branch', '-r'],
workingDirectory: typed(any, named: 'workingDirectory'),
environment: typed(any, named: 'environment')))
.thenReturn(new Future<Process>.value(process));
.thenAnswer((_) => new Future<Process>.value(process));
final ChannelCommand command = new ChannelCommand();
final CommandRunner<Null> runner = createTestCommandRunner(command);

View File

@@ -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)).thenReturn(stdErrStreamController.stream);
when(mockFrontendServerStdErr.transform<String>(any)).thenAnswer((_) => stdErrStreamController.stream);
when(mockFrontendServer.stdin).thenReturn(mockFrontendServerStdIn);
when(mockProcessManager.canRun(any)).thenReturn(true);
when(mockProcessManager.start(any)).thenAnswer(