mvn test报错
1 Scenarios (1 passed) 4 Steps (4 passed) 0m11.846s [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 12.267 s - in cn.x1.AppTest [INFO] Running cn.x1.stepdefs.NhBScoreQueryTest [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.013 s <<< FAILURE! - in cn.x1.stepdefs.NhBScoreQueryTest [ERROR] initializationError(cn.x1.stepdefs.NhBScoreQueryTest) Time elapsed: 0.005 s <<< ERROR! java.lang.Exception: No runnable methods 2019-01-30 10:34:24,137 [ Thread-2 ] - [ INFO ] [ o.s.scheduling.concurrent.ThreadPoolTaskExecutor : 208 ] - Shutting down ExecutorService 'applicationTaskExecutor' [INFO] [INFO] Results: [INFO] [ERROR] Errors: [ERROR] NhBScoreQueryTest.initializationError » No runnable methods [INFO] [ERROR] Tests run: 2, Failures: 0, Errors: 1, Skipped: 0 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 17.620 s [INFO] Finished at: 2019-01-30T10:34:24+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project fcs_api_demo: There are test failures. [ERROR] [ERROR] Please refer to D:\tools\eclipse-jee-oxygen-2-win32-x86_64\eclipse\workspace\fcs_api_demo\target\surefire-reports for the individual test results. [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream. [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
报错原因是因为类名是以Test结尾的,改成其他的即可