当我尝试编译和打包(通过mvn package命令)“Learning Spring with Spring Boot”课程中的以下项目时,默认且唯一的测试失败并抛出 java.lang.IllegalStateException。
我试图做一个 mvn clean,没有运气。pom.xml 和基础项目(因此是默认测试)由https://start.spring.io生成。
我真的不知道去哪里解决这样的问题。
任何帮助,将不胜感激。
谢谢!
这是测试:
package com.frankmoley;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class ReservationsApplicationTests {
@Test
public void contextLoads() {
}
}
这是经过测试的类:
package com.frankmoley;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class ReservationsApplication {
public static void main(String[] args) {
SpringApplication.run(ReservationsApplication.class, args);
}
}
呼唤远方
holdtom
相关分类