Solution for NoClassDefFoundError when unit test java calls classes under different packages:

 

 

 

I checked online, there are many reasons:

https://blog.csdn.net/u013065023/article/details/71171373

 

However, you only need to put the corresponding class in the same package of the class where the unit test is located when doing unit testing (it can run normally), and then put it back when running the entire project.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325219823&siteId=291194637