Exclude some JUnit tests from automated test suite

后端 未结 4 1187
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-19 06:54

When writing code that interacts with external resources (such as using a web service or other network operation), I often structure the classes so that it can also be \"stu

4条回答
  •  梦毁少年i
    2020-12-19 07:57

    If you're just wanting to disable tests for functionality that hasn't been written yet or otherwise manually disable some tests temporarily, you can use @Ignore; the tests will be skipped but still noted in the report.

    If you are wanting something like Spring Profiles, where you can define rulesets for which tests get run when, you should either split up your tests into separate test cases or use a Filter.

提交回复
热议问题