Running Junit Test on a Single File[Resolved]

I am working with tests cases under referenceapplication-ui-tests. I want to be able to run a single file in my IDE. On the encounter of running a single file as Junit test, a pop up appears No tests found with test runner 'JUnit5'. Am able to see junit4.13.jar as one the maven dependency in the project hopefully downloaded automactically via pom.xml .Any help here

You dont need to download junit jar file my dear, its already included in the pom file i think you got me wrong sorry

This means you are running a test that is ignored

If you are using eclipse , Go to the test class , Right click on it → Go to Run As Folder-> Junit test, if that is considered a test meaning without @ignore annotation on top of the class

If you see Run Configurations- → click it and set it to run each configured class as junit test , let me know if this will help you if not we can first switch to uber for like 10 minutes thanks

This can mean two things, you are either running a test class that has junit 5 packages and and junits are configured to run with some other version of Junit ie 2 or 3,or the configuration of running tests is junit five yet you have no junit 5 packages in your class,can i look at the test class you are trying to run,with its importation packages

@kdaud This org.junit.Test is a JUnit 4 annotation. A Junit5 test runner will not discover a test annotated with org.junit.Test .

A Junit5 test runner will discover a test annotated with org.junit.jupiter.api.Test .

So, this explains why you get " No Test found with Test Runner JUnit 5 " when attempting to run a test context which does not contain any tests annotated with org.junit.jupiter.api.Test .

Thanks @sharif @herbert24 @gcliff for the help. I settled things out through adjusting IDE configuration to redirect running tests to JUnit4 otherwise it was being redirected to JUnit5