报错:Clean & maintainable test code requires zero unnecessary code.
报错org.mockito.exceptions.misusing.UnnecessaryStubbingException:Unnecessary stubbings detected in test class: XXXTestClean & maintainable test code requires zero unnecessary code.Following stubbing
·
报错
org.mockito.exceptions.misusing.UnnecessaryStubbingException:
Unnecessary stubbings detected in test class: XXXTest
Clean & maintainable test code requires zero unnecessary code.
Following stubbings are unnecessary (click to navigate to relevant line of code):
1. -> at com.xxx.XXXTest.update_xxx(XXXTest.java:125)
Please remove unnecessary stubbings or use 'lenient' strictness. More info: javadoc for UnnecessaryStubbingException class.
解决
- 在跑test的时候,发现有多余的test代码行,删除 XXXTest.java 125行 的代码即可解决报错。
更多推荐
已为社区贡献1条内容
所有评论(0)