From a612f70d6e31bef54e7a39a9eed0c3895039f46e Mon Sep 17 00:00:00 2001 From: Sitaram Kalluri Date: Tue, 8 Oct 2024 09:45:01 +0530 Subject: [PATCH] fix: Modify error message to fix failing functional test --- .../test/enrollment_test.dart | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/at_onboarding_cli_functional_tests/test/enrollment_test.dart b/tests/at_onboarding_cli_functional_tests/test/enrollment_test.dart index 8d6e9c7a..d458c8eb 100644 --- a/tests/at_onboarding_cli_functional_tests/test/enrollment_test.dart +++ b/tests/at_onboarding_cli_functional_tests/test/enrollment_test.dart @@ -237,10 +237,14 @@ void main() { var completer = Completer(); // 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'], @@ -258,7 +262,7 @@ void main() { AtOnboardingServiceImpl? onboardingService_2 = AtOnboardingServiceImpl(atSign, preference_1); - Future expectLaterFuture = expectLater( + expectLater( onboardingService_2.enroll( 'buzz', 'iphone', @@ -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();