【问题标题】:How to run test cases with the spring-boot framework如何使用 spring-boot 框架运行测试用例
【发布时间】:2018-07-21 23:34:47
【问题描述】:

我下载并成功运行了这个项目:

https://github.com/spring-guides/gs-accessing-data-mongodb

我注意到文件中有一些测试用例:

https://github.com/spring-guides/gs-accessing-data-mongodb/blob/master/complete/src/test/java/hello/CustomerRepositoryTests.java

要从命令行运行主应用程序,我会这样做:

$ ./mvnw spring-boot:run

现在,我想知道我需要执行什么命令才能运行测试用例?

谢谢!

【问题讨论】:

    标签: java spring spring-boot junit


    【解决方案1】:

    您只需要运行此命令即可运行您的测试。

    mvn 测试

    https://spring.io/guides/gs/testing-web/ 可以为您提供有关测试的更多信息。

    【讨论】:

      猜你喜欢
      • 2022-01-19
      • 2016-12-22
      • 1970-01-01
      • 2020-07-28
      • 1970-01-01
      • 2020-02-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多