@@ -207,7 +207,7 @@ void main() {
207
207
};
208
208
209
209
expect (() => policyManager.initialize (jsonPolicies),
210
- throwsA (isA <StateError >()));
210
+ throwsA (isA <PolicySDKException >()));
211
211
expect (policyManager.isInitialized, isFalse);
212
212
});
213
213
@@ -343,7 +343,7 @@ void main() {
343
343
mockStorage.setShouldThrowOnSave (true );
344
344
345
345
expect (() => policyManager.initialize (jsonPolicies),
346
- throwsA (isA <StateError >()));
346
+ throwsA (isA <PolicySDKException >()));
347
347
expect (policyManager.isInitialized, isFalse);
348
348
});
349
349
@@ -425,7 +425,7 @@ void main() {
425
425
426
426
expect (
427
427
() => policyManager.initialize (jsonPolicies),
428
- throwsA (isA <StateError >()),
428
+ throwsA (isA <PolicySDKException >()),
429
429
);
430
430
431
431
expect (policyManager.isInitialized, isFalse);
@@ -444,7 +444,7 @@ void main() {
444
444
445
445
expect (
446
446
() => policyManager.initialize (jsonPolicies),
447
- throwsA (isA <StateError >()),
447
+ throwsA (isA <PolicySDKException >()),
448
448
);
449
449
});
450
450
});
@@ -931,11 +931,14 @@ void main() {
931
931
// Make storage throw on save
932
932
mockStorage.setShouldThrowOnSave (true );
933
933
934
- // The method catches exceptions and doesn't rethrow them
935
- await policyManager
936
- .initializeFromJsonAssets ('assets/policies/test.json' );
934
+ // The method should throw PolicySDKException when storage fails
935
+ expect (
936
+ () => policyManager
937
+ .initializeFromJsonAssets ('assets/policies/test.json' ),
938
+ throwsA (isA <PolicySDKException >()),
939
+ );
937
940
938
- // Should handle gracefully and not initialize due to storage error
941
+ // Should not be initialized due to storage error
939
942
expect (policyManager.isInitialized, isFalse);
940
943
941
944
// Clean up mock message handler
0 commit comments