Mac IDEA Spring Boot 单元测试

2019-05-08  本文已影响0人  minguoIT男
测试类

点击运行后发现:

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

解决方法:在根目录下独立出单独的启动类:

成功运行
上一篇下一篇

猜你喜欢

热点阅读