我正在尝试在创建项目Jar文件之前对我的Spring Boot项目执行"clean and install",但是我遇到了这个错误。
java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test
我是Spring Boot的新手,从未真正利用过它的测试功能。因此,我的测试类基本上是项目最初创建时的默认设置。
我的测试类:
package com.Alex.demo;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class WebAppApplicationTests {
@Test
void contextLoads() {
}
}
文件目录