写Controller单元测试,有@webMvcTest注解,自动忽略@component下的commandLineRanner实例。
但是Service没有@webMvcTest注解。测试的时候会执行commandLineRanner实例。如何不执行这个实例呢?
https://blog.csdn.net/u013725455/article/details/79322286
这个问题我去年就解决了。
https://blog.csdn.net/w_rcss/article/details/75271808