Junit: splitting integration test and Unit tests

后端 未结 6 2223
谎友^
谎友^ 2020-12-22 16:05

I\'ve inherited a load of Junit test, but these tests (apart from most not working) are a mixture of actual unit test and integration tests (requiring external systems, db e

6条回答
  •  春和景丽
    2020-12-22 17:01

    We use Maven Surefire Plugin to run unit tests and Maven Failsafe Plugin to run integration tests. Unit tests follow the **/Test*.java **/*Test.java **/*TestCase.java naming conventions, integration tests - **/IT*.java **/*IT.java **/*ITCase.java. So it's actually your option number three.

    In a couple of projects we use TestNG and define different test groups for integration/unit tests, but this is probably not suitable for you.

提交回复
热议问题