Again move mockito to 300plus2 (#15981)

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

This reverts commit e59651f925.

* More thenReturn to thenAnswer when mocking Futures

* Revert "More thenReturn to thenAnswer when mocking Futures"

This reverts commit 194d2cf41754ad171efd6bb5898cf73bce5a75ab as we are reverting engine roll.

* Revert "Revert "More thenReturn to thenAnswer when mocking Futures""

This reverts commit 52c9e96b304b220f66d78a252fccea0c8e0ef24c.

* Add dependency override

* Fix issue
This commit is contained in:
Alexander Aprelev
2018-03-28 12:07:12 -07:00
committed by GitHub
parent 31049a5a73
commit bffae21571
18 changed files with 29 additions and 28 deletions

View File

@@ -21,7 +21,7 @@ dependencies:
dev_dependencies:
test: 0.12.32+2
mockito: 2.2.3
mockito: 3.0.0-alpha+2
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"

View File

@@ -13,7 +13,7 @@ dev_dependencies:
flutter_test:
sdk: flutter
mockito: 2.2.3
mockito: 3.0.0-alpha+2
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"

View File

@@ -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))).thenReturn(new Future<HttpClientRequest>.value(request));
when(client.getUrl(typed(any))).thenAnswer((_) => new Future<HttpClientRequest>.value(request));
when(request.headers).thenReturn(headers);
when(request.close()).thenReturn(new Future<HttpClientResponse>.value(response));
when(request.close()).thenAnswer((_) => 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) {

View File

@@ -24,7 +24,7 @@ dependencies:
dev_dependencies:
test: 0.12.32+2
mockito: 2.2.3
mockito: 3.0.0-alpha+2
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"