我有一个在
下运行的测试@RunWith(SpringRunner.class)
@SpringBootTest
@Test
public void testFind() throws IOException {
Review<Hostel> hostelByComplaintId =
hostelService.findByComplaintId(complaintId).orElse(null);
assertThat(hostelByComplaintId).isNotNull();
}
当我从命令行mvn test
运行测试时,出现此错误
Failed tests:
Expecting actual not to be null
但是当我从IntelliJ IDEA运行它时,测试不会失败
答案 0 :(得分:0)
如果您的项目中有任何测试用例可以运行,您可以编写完整的命令
mvn clean install
如果要禁用运行测试用例
mvn clean install -Dmaven.test.skip=true