简体   繁体   中英

Is it possible to only run one test class (that leverages PowerMock and Mockito)?

I am currently working on a project (with IntelliJ) with unit tests powered by PowerMock (for mocking final classes), and includes mocks using Mockito. The test suite takes a bit of time to run (via mvn test ).

Is it possible to only run one test class (the one I'm working on)? It is a maven project, but I'm happy with any runner.

(If it helps with analogies/examples, I'm coming from a C#/NUnit background).

For Maven, see http://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html

If you're using Intellij Idea, position your cursor on the test method name and hit Ctrl+Shift+F10 (or right click on the method name and select the Run option)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM