-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Response wrong status code for some situation for openAPI #11864
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #11864 +/- ##
=============================================
+ Coverage 67.91% 68.61% +0.69%
- Complexity 8915 9027 +112
=============================================
Files 1236 1239 +3
Lines 40459 40584 +125
Branches 4292 4317 +25
=============================================
+ Hits 27479 27845 +366
+ Misses 11003 10746 -257
- Partials 1977 1993 +16
... and 28 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you help add some unit test?
ok,I will add |
1 similar comment
ok,I will add |
I would like to ask if there is already a NacosRuntimeExceptionTest. Is the unit test you mentioned specifically for defect # 11842 |
You change the code in many XXXExceptionHandler.java, so you should add some unit test to test you add or change logic is work well not relative NacosRuntimeExceptionTest. |
Why does my unit test affect other unit tests? I would like to seek help. This is my first PR @KomachiSion |
I retry the ci with several times, but every time can't pass with UdpConnectorTest. It might some UT you added affect the UdpConnectorTest so that it can't pass, I will try it last time, if can't pass again with UdpConnectorTest, it should be fixed in this PR by you. Thanks. |
From the old information, some mock in UdpConnectorTest is marked useless, maybe you added UT has init some static variable and make the UdpConnectorTest mock useless. If last time retry still failed by this reason, I suggest you see the error info and find out which mock is marked useless, and to make UT use the mock. |
Can I modify the UdpConnectorTest class? |
and I want to know if the logic of my unit testing is correct @KomachiSion |
How do you want to modify it? |
Your UT logic is ok, but you use WebMvc to start ut, the WebMvc will build the mock spring container, and spring container will build some bean and static variable. When bean and static variable mock build by |
Is there a better way not to use mockmvc? I'm trying other methods. The bean in the container does not have xxxxexceptionHandler, which makes it unable to handle exceptions |
and currently, I have not found any unit tests for exception handling classes in the source code of Nacos |
You can just remove the webmvc |
Thks |
link #11842