Issue
I am experiencing a strange behavior of Intellij IDEA 2016.3. Having a class with method foo
and a JUnit test for the method when I get java.lang.Exception: No tests found matching Method foo
when running the test. After I do mvn test
it succeeds and then running the unit test right after executing mvn command it suddenly runs green. Seems like IDEA does not compile automatically. How can I fix this?
P.S. No settings were altered after upgrading to v. 2016.3
Solution
Well, after "playing" a bit with run configurations of each unit test I noticed that each Run Config has a Build
goal preset in the Before Launch
option (See pic below):
After changing Build
to Build Project
the tests run fine.
Answered By - Arthur Eirich
Answer Checked By - Timothy Miller (JavaFixing Admin)