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

@@ -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) {