Java mvn测试失败,但从IntelliJ IDEA pass运行测试
我做了一个测试Java mvn测试失败,但从IntelliJ IDEA pass运行测试,java,spring,spring-boot,intellij-idea,junit,Java,Spring,Spring Boot,Intellij Idea,Junit,我做了一个测试 @RunWith(SpringRunner.class) @SpringBootTest @Test public void testFind() throws IOException { Review<Hostel> hostelByComplaintId = hostelService.findByComplaintId(complaintId).orElse(null); assertThat(ho
@RunWith(SpringRunner.class)
@SpringBootTest
@Test
public void testFind() throws IOException {
Review<Hostel> hostelByComplaintId =
hostelService.findByComplaintId(complaintId).orElse(null);
assertThat(hostelByComplaintId).isNotNull();
}
但是当我从IntelliJ IDEA运行它时,测试并没有失败如果您的项目中有任何测试用例发现它将运行,您可以编写完整的命令
mvn clean install
如果要禁用运行测试用例
mvn clean install -Dmaven.test.skip=true
如何复制您的问题?请提供答案。信息不足。瞎猜:您在terminal和intellij中使用相同的maven版本吗?
mvn clean install -Dmaven.test.skip=true