Bump mockito to 3.0.0-beta (#18462)
* Bump mockito to 3.0.0-beta * Few fixes * fix test * Bump image * Fix * New packages update * With matcher pinned * No more typed
This commit is contained in:
committed by
Alexander Aprelev
parent
bec912165a
commit
9f8a70be4c
@@ -11,12 +11,12 @@ 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(any)).thenAnswer((_) => new Future<HttpClientRequest>.value(request));
|
||||
when(request.headers).thenReturn(headers);
|
||||
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) {
|
||||
when(response.listen(any)).thenAnswer((Invocation invocation) {
|
||||
final void Function(List<int>) onData = invocation.positionalArguments[0];
|
||||
final void Function() onDone = invocation.namedArguments[#onDone];
|
||||
final void Function(Object, [StackTrace]) onError = invocation.namedArguments[#onError];
|
||||
@@ -32,4 +32,4 @@ class MockHttpClientRequest extends Mock implements HttpClientRequest {}
|
||||
|
||||
class MockHttpClientResponse extends Mock implements HttpClientResponse {}
|
||||
|
||||
class MockHttpHeaders extends Mock implements HttpHeaders {}
|
||||
class MockHttpHeaders extends Mock implements HttpHeaders {}
|
||||
|
||||
Reference in New Issue
Block a user