Revert "More thenReturn to thenAnswer when mocking Futures"

This reverts commit 194d2cf417 as we are reverting engine roll.
This commit is contained in:
Alexander Aprelev 2018-03-27 11:01:18 -07:00
parent 194d2cf417
commit 52c9e96b30
3 changed files with 6 additions and 6 deletions

View File

@ -37,9 +37,9 @@ void main() {
mockVM = new MockVM();
mockIsolate = new MockIsolate();
mockPeer = new MockPeer();
when(mockClient.getVM()).thenAnswer((_) => new Future<MockVM>.value(mockVM));
when(mockClient.getVM()).thenReturn(new Future<MockVM>.value(mockVM));
when(mockVM.isolates).thenReturn(<VMRunnableIsolate>[mockIsolate]);
when(mockIsolate.loadRunnable()).thenAnswer((_) => new Future<MockIsolate>.value(mockIsolate));
when(mockIsolate.loadRunnable()).thenReturn(new Future<MockIsolate>.value(mockIsolate));
when(mockIsolate.invokeExtension(typed(any), typed(any))).thenAnswer(
(Invocation invocation) => makeMockResponse(<String, dynamic>{'status': 'ok'}));
vmServiceConnectFunction = (String url) {

View File

@ -31,7 +31,7 @@ void main() {
const String interface = 'eno1';
// Adds some extra junk to make sure the strings will be cleaned up.
when(mockRunner.run(typed(any)))
.thenAnswer((_) => new Future<List<String>>.value(
.thenReturn(new Future<List<String>>.value(
<String>['123\n\n\n', '456 ', '789']));
when(mockRunner.address).thenReturn(address);
when(mockRunner.interface).thenReturn(interface);

View File

@ -40,8 +40,8 @@ void main() {
setUp(() {
mockProcessManager = new MockProcessManager();
mockProcessResult = new MockProcessResult();
when(mockProcessManager.run(typed(any))).thenAnswer(
(_) => new Future<MockProcessResult>.value(mockProcessResult));
when(mockProcessManager.run(typed(any))).thenReturn(
new Future<MockProcessResult>.value(mockProcessResult));
});
test('verify interface is appended to ipv6 address', () async {