Why does Intellij IDEA suddenly not recognize tests in test folder anymore?

后端 未结 13 2139
深忆病人
深忆病人 2021-02-01 02:26

I\'m using JUnit since I started this project and everything works just fine. I have a couple of hundreds tests, and of course, here and there I start them all. Right click on r

13条回答
  •  抹茶落季
    2021-02-01 02:58

    For some reason Intellij Idea don't recognize classes as Test class that are not explicitly public, in case class has default access specificator it will not be marked as a test. Try to change class to meet this rule. Example:

    public class TestMe {
          
     @Test
          
     public void shouldTest(){
           
         Assert.assertEquals("test", "test");
     }
    }
    

提交回复
热议问题