天天看點

SpringJunit Test異常問題

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

    at org.springframework.util.Assert.state(Assert.java:73)
    at org.springframework.boot.test.context.SpringBootTestContextBootstrapper.getOrFindConfigurationClasses(SpringBootTestContextBootstrapper.java:240)
           
@SpringBootTest()改為@SpringBootTest(classes = MangeCmsApplication.class)      

https://blog.csdn.net/csdn_am/article/details/79757097