@@ -6,6 +6,7 @@ import 'package:package_info_plus/package_info_plus.dart';
66import 'package:sentry/src/platform/platform.dart' ;
77import 'package:sentry/src/dart_exception_type_identifier.dart' ;
88import 'package:sentry_flutter/sentry_flutter.dart' ;
9+ import 'package:sentry_flutter/src/file_system_transport.dart' ;
910import 'package:sentry_flutter/src/flutter_exception_type_identifier.dart' ;
1011import 'package:sentry_flutter/src/integrations/connectivity/connectivity_integration.dart' ;
1112import 'package:sentry_flutter/src/integrations/integrations.dart' ;
@@ -70,34 +71,31 @@ void main() {
7071 });
7172
7273 test ('Android' , () async {
73- List < Integration > integrations = [] ;
74- Transport transport = MockTransport () ;
74+ late final SentryFlutterOptions options ;
75+ late final Transport transport ;
7576
7677 final sentryFlutterOptions = defaultTestOptions (
7778 getPlatformChecker (platform: MockPlatform .android ()))
7879 ..methodChannel = native .channel;
7980
8081 await SentryFlutter .init (
81- (options ) async {
82- options .dsn = fakeDsn;
83- options .profilesSampleRate = 1.0 ;
84- integrations = options.integrations ;
85- transport = options .transport;
82+ (o ) async {
83+ o .dsn = fakeDsn;
84+ o .profilesSampleRate = 1.0 ;
85+ options = o ;
86+ transport = o .transport;
8687 },
8788 appRunner: appRunner,
8889 options: sentryFlutterOptions,
8990 );
9091
91- testTransport (
92- transport: transport,
93- hasFileSystemTransport: true ,
94- );
92+ expect (transport, isA <FileSystemTransport >());
9593
9694 testScopeObserver (
9795 options: sentryFlutterOptions, expectedHasNativeScopeObserver: true );
9896
9997 testConfiguration (
100- integrations: integrations,
98+ integrations: options. integrations,
10199 shouldHaveIntegrations: [
102100 ...androidIntegrations,
103101 ...nativeIntegrations,
@@ -110,49 +108,51 @@ void main() {
110108 ],
111109 );
112110
113- integrations
111+ options. integrations
114112 .indexWhere ((element) => element is WidgetsFlutterBindingIntegration );
115113
116114 testBefore (
117- integrations: integrations,
115+ integrations: options. integrations,
118116 beforeIntegration: WidgetsFlutterBindingIntegration ,
119117 afterIntegration: OnErrorIntegration );
120118
119+ expect (
120+ options.eventProcessors.indexOfTypeString ('IoEnricherEventProcessor' ),
121+ greaterThan (options.eventProcessors
122+ .indexOfTypeString ('_LoadContextsIntegrationEventProcessor' )));
123+
121124 expect (SentryFlutter .native , isNotNull);
122125 expect (Sentry .currentHub.profilerFactory, isNull);
123126
124127 await Sentry .close ();
125128 }, testOn: 'vm' );
126129
127130 test ('iOS' , () async {
128- List < Integration > integrations = [] ;
129- Transport transport = MockTransport () ;
131+ late final SentryFlutterOptions options ;
132+ late final Transport transport ;
130133
131134 final sentryFlutterOptions =
132135 defaultTestOptions (getPlatformChecker (platform: MockPlatform .iOs ()))
133136 ..methodChannel = native .channel;
134137
135138 await SentryFlutter .init (
136- (options ) async {
137- options .dsn = fakeDsn;
138- options .profilesSampleRate = 1.0 ;
139- integrations = options.integrations ;
140- transport = options .transport;
139+ (o ) async {
140+ o .dsn = fakeDsn;
141+ o .profilesSampleRate = 1.0 ;
142+ options = o ;
143+ transport = o .transport;
141144 },
142145 appRunner: appRunner,
143146 options: sentryFlutterOptions,
144147 );
145148
146- testTransport (
147- transport: transport,
148- hasFileSystemTransport: true ,
149- );
149+ expect (transport, isA <FileSystemTransport >());
150150
151151 testScopeObserver (
152152 options: sentryFlutterOptions, expectedHasNativeScopeObserver: true );
153153
154154 testConfiguration (
155- integrations: integrations,
155+ integrations: options. integrations,
156156 shouldHaveIntegrations: [
157157 ...iOsAndMacOsIntegrations,
158158 ...nativeIntegrations,
@@ -166,14 +166,19 @@ void main() {
166166 );
167167
168168 testBefore (
169- integrations: integrations,
169+ integrations: options. integrations,
170170 beforeIntegration: WidgetsFlutterBindingIntegration ,
171171 afterIntegration: OnErrorIntegration );
172172
173173 expect (SentryFlutter .native , isNotNull);
174174 expect (Sentry .currentHub.profilerFactory,
175175 isInstanceOf <SentryNativeProfilerFactory >());
176176
177+ expect (
178+ options.eventProcessors.indexOfTypeString ('IoEnricherEventProcessor' ),
179+ greaterThan (options.eventProcessors
180+ .indexOfTypeString ('_LoadContextsIntegrationEventProcessor' )));
181+
177182 await Sentry .close ();
178183 }, testOn: 'vm' );
179184
@@ -195,10 +200,7 @@ void main() {
195200 options: sentryFlutterOptions,
196201 );
197202
198- testTransport (
199- transport: transport,
200- hasFileSystemTransport: true ,
201- );
203+ expect (transport, isA <FileSystemTransport >());
202204
203205 testScopeObserver (
204206 options: sentryFlutterOptions, expectedHasNativeScopeObserver: true );
@@ -244,10 +246,7 @@ void main() {
244246 options: sentryFlutterOptions,
245247 );
246248
247- testTransport (
248- transport: transport,
249- hasFileSystemTransport: false ,
250- );
249+ expect (transport, isNot (isA <FileSystemTransport >()));
251250
252251 testScopeObserver (
253252 options: sentryFlutterOptions, expectedHasNativeScopeObserver: true );
@@ -295,10 +294,7 @@ void main() {
295294 options: sentryFlutterOptions,
296295 );
297296
298- testTransport (
299- transport: transport,
300- hasFileSystemTransport: false ,
301- );
297+ expect (transport, isNot (isA <FileSystemTransport >()));
302298
303299 testScopeObserver (
304300 options: sentryFlutterOptions, expectedHasNativeScopeObserver: true );
@@ -345,10 +341,7 @@ void main() {
345341 options: sentryFlutterOptions,
346342 );
347343
348- testTransport (
349- transport: transport,
350- hasFileSystemTransport: false ,
351- );
344+ expect (transport, isNot (isA <FileSystemTransport >()));
352345
353346 testScopeObserver (
354347 options: sentryFlutterOptions, expectedHasNativeScopeObserver: false );
@@ -396,10 +389,7 @@ void main() {
396389 options: sentryFlutterOptions,
397390 );
398391
399- testTransport (
400- transport: transport,
401- hasFileSystemTransport: false ,
402- );
392+ expect (transport, isNot (isA <FileSystemTransport >()));
403393
404394 testConfiguration (
405395 integrations: integrations,
@@ -441,10 +431,7 @@ void main() {
441431 options: sentryFlutterOptions,
442432 );
443433
444- testTransport (
445- transport: transport,
446- hasFileSystemTransport: false ,
447- );
434+ expect (transport, isNot (isA <FileSystemTransport >()));
448435
449436 testConfiguration (
450437 integrations: integrations,
@@ -487,10 +474,7 @@ void main() {
487474 options: sentryFlutterOptions,
488475 );
489476
490- testTransport (
491- transport: transport,
492- hasFileSystemTransport: false ,
493- );
477+ expect (transport, isNot (isA <FileSystemTransport >()));
494478
495479 testConfiguration (
496480 integrations: integrations,
0 commit comments