Search This Blog

Sunday 19 April 2020

Junit-Eclipse No tests found using JUnit 5 or junit4

Issue
Pop up in eclipse saying junit4 tests not found. Not an issue with maven.




Root Cause
Run As-> 'Run Configurations' -> "Test runner:" = junits5 while the tests are written with junit4 api’s.

Resolution
Fixed the issue by right clicking the test and selecting 'Run Configurations' and changing the "Test runner:" selection to 'JUnit 4' as shown here:




The issue can also occur if it’s the other way-round also.



No comments:

Post a Comment