@@ -20,6 +20,7 @@ import 'network_logger_test.mocks.dart';
2020 HttpClientCredentials ,
2121])
2222void main () {
23+ TestWidgetsFlutterBinding .ensureInitialized ();
2324 WidgetsFlutterBinding .ensureInitialized ();
2425
2526 final List <MethodCall > log = < MethodCall > [];
@@ -53,8 +54,9 @@ void main() {
5354 when (mockRequest.followRedirects).thenAnswer ((_) => true );
5455 when (mockRequest.maxRedirects).thenAnswer ((_) => 5 );
5556 when (mockRequest.persistentConnection).thenAnswer ((_) => true );
56-
57- instabugCustomHttpClientRequest = InstabugCustomHttpClientRequest (mockRequest, instabugCustomHttpClient.logger);
57+
58+ instabugCustomHttpClientRequest = InstabugCustomHttpClientRequest (
59+ mockRequest, instabugCustomHttpClient.logger);
5860
5961 expect (mockRequest, isInstanceOf <HttpClientRequest >());
6062 expect (mockResponse, isInstanceOf <HttpClientResponse >());
@@ -393,8 +395,10 @@ void main() {
393395 test ('expect instabug custom http client to set client authenticate' ,
394396 () async {
395397 final Future <bool > Function (Uri url, String scheme, String realm) f =
396- (Uri url, String scheme, String realm) async => true ;
397- instabugCustomHttpClient.authenticate = f;
398+ (Uri url, String scheme, String ? realm) async => true ;
399+
400+ instabugCustomHttpClient.authenticate =
401+ f as Future <bool > Function (Uri url, String scheme, String ? realm);
398402 verify ((instabugCustomHttpClient.client as MockHttpClient ).authenticate = f)
399403 .called (1 );
400404 });
@@ -403,8 +407,9 @@ void main() {
403407 () async {
404408 final Future <bool > Function (
405409 String host, int port, String scheme, String realm) f =
406- (String host, int port, String scheme, String realm) async => true ;
407- instabugCustomHttpClient.authenticateProxy = f;
410+ (String host, int port, String scheme, String ? realm) async => true ;
411+ instabugCustomHttpClient.authenticateProxy = f as Future <bool > Function (
412+ String host, int port, String scheme, String ? realm);
408413 verify ((instabugCustomHttpClient.client as MockHttpClient )
409414 .authenticateProxy = f)
410415 .called (1 );
0 commit comments