Skip to content

Commit

Permalink
fix: Modify error message to fix failing functional test
Browse files Browse the repository at this point in the history
  • Loading branch information
sitaram-kalluri committed Oct 8, 2024
1 parent f5e2b3f commit a612f70
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,14 @@ void main() {
var completer = Completer<void>(); // Create a Completer

//4. Subscribe to enrollment notifications; we will deny it when it arrives
String enrollmentId = '';
onboardingService_1.atClient!.notificationService
.subscribe(regex: '.__manage')
.listen(expectAsync1((notification) async {
logger.finer('got enroll notification');
final notificationKey = notification.key;
enrollmentId = notificationKey.substring(
0, notificationKey.indexOf('.new.enrollments'));
expect(notification.value, isNotNull);
var notificationValueJson = jsonDecode(notification.value!);
expect(notificationValueJson['encryptedApkamSymmetricKey'],
Expand All @@ -258,7 +262,7 @@ void main() {
AtOnboardingServiceImpl? onboardingService_2 =
AtOnboardingServiceImpl(atSign, preference_1);

Future<dynamic> expectLaterFuture = expectLater(
expectLater(
onboardingService_2.enroll(
'buzz',
'iphone',
Expand All @@ -267,8 +271,8 @@ void main() {
retryInterval: Duration(seconds: 5),
),
throwsA(predicate((dynamic e) =>
e is AtEnrollmentException && e.message == 'enrollment denied')));
print(await expectLaterFuture);
e is AtEnrollmentException &&
e.message == 'The enrollment: $enrollmentId is denied')));
await completer.future;

await onboardingService_1.close();
Expand Down

0 comments on commit a612f70

Please sign in to comment.