解决java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use

springboot测试时出现:java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test

It's because I didn't write a springboot startup class in the root directory: write an App.class, and then run the test class to avoid this error.

My motto: No, I can learn; I fall behind, I can catch up; I fall, I can stand up; I will do it.

Guess you like

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