错题集
急景凋年
这个作者很懒,什么都没留下…
展开
-
IDEA无法启动: The IDE cannot create the directory
解决IDEA因为读写权限无法启动的问题原创 2021-12-07 17:38:47 · 4641 阅读 · 1 评论 -
springboot升级后mvn test找不到单元测试
Springboot版本从2.1.11.RELEASE升级到2.4.3之后发现执行 mvn test找不到单元测试执行了。之前了解过某个 2.x 版本后的spring-boot-test默认使用Junit5作为默认测试执行器,而现有代码中的测试使用的是Junit4进行编写,怀疑是此原因造成。在junit5相关文档中找到了相关描述,意思是说,想要 maven-surefire-plugin执行 Junit 的测试,在依赖中必须要声明一个TestEngine的实现:<!-- Junit5 配置实现原创 2021-04-08 09:06:04 · 2759 阅读 · 0 评论 -
mockStatic时抛出java.lang.ExceptionInInitializerError
解决方法在测试类上增加注解@SuppressStaticInitializationFor("org.mycompany.ClassWithEvilStaticInitializer")里面填上你要mock类的包名+类名参考资料https://github.com/powermock/powermock/wiki/Suppress-Unwanted-Behaviorhttps://stackoverflow.com/questions/38679426/java-lang-excepti原创 2020-12-25 10:31:01 · 1920 阅读 · 1 评论