我进行了此测试
@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运行它时,测试不会失败
如果您的项目中有任何测试用例可以运行,您可以编写完整的命令
mvn clean install
如果要禁用运行测试用例
mvn clean install -Dmaven.test.skip=true
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句