Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/397.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java mvn测试失败,但从IntelliJ IDEA pass运行测试_Java_Spring_Spring Boot_Intellij Idea_Junit - Fatal编程技术网

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