使用mvn test
mvn test -Dtest=测试包名.测试类名时
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project xxx-xxx: No tests were executed! (Set -DfailIfNoTests=false to ignore this error.) -> [Help 1]
解决办法:按照提示: mvn test -Dtest=测试包名.测试类名 -DfailIfNoTests=false即可通过测试