New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: No such field exception for client method call in a test function #42693
Comments
The problem is only reproducible when the client definition is outside of the respective test file. Once the definition is placed along with the test function in the same file, the error is not generated. |
Yes, the issue arises when we have the generated code for test. There seems to be an inconsistency in the generated byte code for the tests and main, where we call a field to get the default value for this resource method argument. |
@nipunayf Shall we check the generated jar and verify whether this field is there? |
The slash in the resource method is causing the issue. If we remove that slash, it works fine. The following snippets show various instances of generated code.
@gabilang can you have a look on it? |
Description
Getting no such field exception when I have a client method call inside the test function. The client method has escape characters and has a default parameter.
If I move the same code in the test function to the main function then it worked as expected
It seems like an issue in the generated code for the test function
Steps to Reproduce
Create a ballerina project
Add the following to
main.bal
Add the following test function in the
tests
directoryRun
bal run
- This is workingRun
bal test
:Affected Version(s)
SwanLake Update 8 (2201.8.6)
SwanLake Update 9 (2201.9.0)
OS, DB, other environment details and versions
No response
Related area
-> Test Framework
Related issue(s) (optional)
No response
Suggested label(s) (optional)
No response
Suggested assignee(s) (optional)
No response
The text was updated successfully, but these errors were encountered: