You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/10/17 05:26:44 UTC

[GitHub] [dubbo] pandaapo commented on pull request #10683: remind user to add qos dependency.(Fixes #10682)

pandaapo commented on PR #10683:
URL: https://github.com/apache/dubbo/pull/10683#issuecomment-1280307834

   > ![image](https://user-images.githubusercontent.com/9292748/196081867-83c79aa0-a1e0-4dff-9ed3-68b955b4121e.png)
   
   I want to test `ConfigValidationUtils#checkQosDependency()`, but the method has no testable item except `logger#warn()`. So I intend to mock `logger` field, but it's a final field. I have to handle it with reflection. Now JDK17 seems forbid this operation for safety. I have no good idea for now. Could you give me some suggestions?
   想测试`ConfigValidationUtils#checkQosDependency()`方法,但是该方法没有返回值、没有抛异常之类的可测试项,只有logger打印日志。于是就考虑注入Mock(logger),但是logger是final字段,只好利用反射来处理下,但是JDK17好像为提高安全性不支持这种操作,一时间没想到好办法。能否给一些建议?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org