From 09c9bdc71e6b5dfd62b8b6514f8c090c907350ce Mon Sep 17 00:00:00 2001 From: Krishnananthalingam Tharmigan <63336800+TharmiganK@users.noreply.github.com> Date: Thu, 1 Feb 2024 17:32:45 +0530 Subject: [PATCH] Fix error message assertion --- ballerina/tests/subscription_initiation_test.bal | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ballerina/tests/subscription_initiation_test.bal b/ballerina/tests/subscription_initiation_test.bal index d494f289..90846020 100644 --- a/ballerina/tests/subscription_initiation_test.bal +++ b/ballerina/tests/subscription_initiation_test.bal @@ -273,11 +273,9 @@ function testSubInitFailedWithListenerForSubFailure() returns error? { var startDetails = ls.'start(); test:assertTrue(startDetails is error); if startDetails is error { - string expectedStart = "Subscription initiation failed due to: Error in request: Mode[subscribe] at Hub[http://127.0.0.1:9192/common/failed] - "; - string expectedEnd = "\"status\":404, \"reason\":\"Not Found\", \"message\":\"no matching resource found for" + - " path\", \"path\":\"/common/failed\", \"method\":\"POST\"}"; - test:assertTrue(startDetails.message().startsWith(expectedStart)); - test:assertTrue(startDetails.message().endsWith(expectedEnd)); + string expected = "Subscription initiation failed due to: Error in request: Mode[subscribe] at Hub[http://127.0.0.1:9192/common/failed] - "; + test:assertTrue(startDetails.message().startsWith(expected)); + test:assertTrue(startDetails.message().includes("no matching resource found for path")); } check ls.gracefulStop(); }