【Exception】Cannot instantiate test(s): java.lang.SecurityException: Prohibited package name: java.cn

案发现场

单元测试时

Cannot instantiate test(s): java.lang.SecurityException: Prohibited package name: java.cn.itplh.common.util

Process finished with exit code 1

原因分析

解决方案

在测试类中包名不能以java开头

将包改为cn.itplh.common.util就好了。

猜你喜欢

转载自blog.csdn.net/AV_woaijava/article/details/106700822