1
1
import 'dart:convert' ;
2
2
import 'package:flutter/foundation.dart' ;
3
+ import 'package:flutter_policy_engine/src/exceptions/policy_sdk_exception.dart' ;
3
4
import 'package:flutter_test/flutter_test.dart' ;
4
5
import 'package:flutter_policy_engine/src/core/policy_manager.dart' ;
5
6
import 'package:flutter_policy_engine/src/core/interfaces/i_policy_evaluator.dart' ;
@@ -493,7 +494,7 @@ void main() {
493
494
test ('should handle empty asset path' , () async {
494
495
expect (
495
496
() => policyManager.initializeFromJsonAssets ('' ),
496
- throwsA (isA <ArgumentError >()),
497
+ throwsA (isA <PolicySDKException >()),
497
498
);
498
499
});
499
500
@@ -982,7 +983,7 @@ void main() {
982
983
983
984
expect (
984
985
() => policyManager.addRole (invalidRole),
985
- throwsA (isA <ArgumentError >()),
986
+ throwsA (isA <PolicySDKException >()),
986
987
);
987
988
});
988
989
@@ -1085,7 +1086,7 @@ void main() {
1085
1086
1086
1087
expect (
1087
1088
() => policyManager.removeRole ('' ),
1088
- throwsA (isA <ArgumentError >()),
1089
+ throwsA (isA <PolicySDKException >()),
1089
1090
);
1090
1091
});
1091
1092
@@ -1209,7 +1210,7 @@ void main() {
1209
1210
1210
1211
expect (
1211
1212
() => policyManager.updateRole ('' , role),
1212
- throwsA (isA <ArgumentError >()),
1213
+ throwsA (isA <PolicySDKException >()),
1213
1214
);
1214
1215
});
1215
1216
@@ -1222,7 +1223,7 @@ void main() {
1222
1223
1223
1224
expect (
1224
1225
() => policyManager.updateRole ('' , invalidRole),
1225
- throwsA (isA <ArgumentError >()),
1226
+ throwsA (isA <PolicySDKException >()),
1226
1227
);
1227
1228
});
1228
1229
0 commit comments