From 7fa77964bf5fdcdf1cd4ceecb33b23f652ecf10e Mon Sep 17 00:00:00 2001 From: hindujaB Date: Thu, 5 Oct 2023 10:34:16 +0530 Subject: [PATCH] Fix error creation tests --- .../nativeimpl/jvm/runtime/api/tests/Values.java | 5 +---- .../test-src/runtime/api/values/modules/errors/errors.bal | 6 ++++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/jballerina-unit-test/src/test/java/org/ballerinalang/nativeimpl/jvm/runtime/api/tests/Values.java b/tests/jballerina-unit-test/src/test/java/org/ballerinalang/nativeimpl/jvm/runtime/api/tests/Values.java index 595d74c9acb8..e15cda5a2072 100644 --- a/tests/jballerina-unit-test/src/test/java/org/ballerinalang/nativeimpl/jvm/runtime/api/tests/Values.java +++ b/tests/jballerina-unit-test/src/test/java/org/ballerinalang/nativeimpl/jvm/runtime/api/tests/Values.java @@ -500,10 +500,7 @@ public static BError getErrorValue(BString errorTypeName) { BString errorMsg = StringUtils.fromString("error message!"); BError bError = ErrorCreator.createError(errorModule, errorTypeName.getValue(), errorTypeName, ErrorCreator.createError(errorMsg), ValueCreator.createMapValue()); - // TODO: fix https://github.com/ballerina-platform/ballerina-lang/issues/41025 - String typeName = errorTypeName.getValue().equals("ResourceDispatchingError") ? - "RequestDispatchingError" : errorTypeName.getValue(); - assert bError.getType().getName().equals(typeName); + assert bError.getType().getName().equals(errorTypeName.getValue()); return bError; } } diff --git a/tests/jballerina-unit-test/src/test/resources/test-src/runtime/api/values/modules/errors/errors.bal b/tests/jballerina-unit-test/src/test/resources/test-src/runtime/api/values/modules/errors/errors.bal index eddfd2c87c27..9ef879944eb0 100644 --- a/tests/jballerina-unit-test/src/test/resources/test-src/runtime/api/values/modules/errors/errors.bal +++ b/tests/jballerina-unit-test/src/test/resources/test-src/runtime/api/values/modules/errors/errors.bal @@ -34,6 +34,12 @@ public function validateAPI() { errorVar = getErrorValue("ResourceNotFoundError"); test:assertTrue(errorVar is ResourceNotFoundError); + + errorVar = getErrorValue("RequestDispatchingError"); + test:assertTrue(errorVar is RequestDispatchingError); + + errorVar = getErrorValue("StatusCodeError"); + test:assertTrue(errorVar is StatusCodeError); } function getErrorValue(string errorTypeName) returns error = @java:Method {