Skip to content

Commit fa55733

Browse files
test(policy_manager): replace ArgumentError with PolicySDKException in role management tests
1 parent e298e72 commit fa55733

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

test/core/policy_manager_test.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'dart:convert';
22
import 'package:flutter/foundation.dart';
3+
import 'package:flutter_policy_engine/src/exceptions/policy_sdk_exception.dart';
34
import 'package:flutter_test/flutter_test.dart';
45
import 'package:flutter_policy_engine/src/core/policy_manager.dart';
56
import 'package:flutter_policy_engine/src/core/interfaces/i_policy_evaluator.dart';
@@ -493,7 +494,7 @@ void main() {
493494
test('should handle empty asset path', () async {
494495
expect(
495496
() => policyManager.initializeFromJsonAssets(''),
496-
throwsA(isA<ArgumentError>()),
497+
throwsA(isA<PolicySDKException>()),
497498
);
498499
});
499500

@@ -982,7 +983,7 @@ void main() {
982983

983984
expect(
984985
() => policyManager.addRole(invalidRole),
985-
throwsA(isA<ArgumentError>()),
986+
throwsA(isA<PolicySDKException>()),
986987
);
987988
});
988989

@@ -1085,7 +1086,7 @@ void main() {
10851086

10861087
expect(
10871088
() => policyManager.removeRole(''),
1088-
throwsA(isA<ArgumentError>()),
1089+
throwsA(isA<PolicySDKException>()),
10891090
);
10901091
});
10911092

@@ -1209,7 +1210,7 @@ void main() {
12091210

12101211
expect(
12111212
() => policyManager.updateRole('', role),
1212-
throwsA(isA<ArgumentError>()),
1213+
throwsA(isA<PolicySDKException>()),
12131214
);
12141215
});
12151216

@@ -1222,7 +1223,7 @@ void main() {
12221223

12231224
expect(
12241225
() => policyManager.updateRole('', invalidRole),
1225-
throwsA(isA<ArgumentError>()),
1226+
throwsA(isA<PolicySDKException>()),
12261227
);
12271228
});
12281229

0 commit comments

Comments
 (0)