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

后端 未结 13 2171
深忆病人
深忆病人 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:57

    Just to add a different scenario, which happened to me and some of my coworkers:

    Alt+enter in the class -> create test: IJ (2017.1.1) proposes Arquillian Junit as first option of testing library and by going with it the test class and methods are created without the 'public' identifier. Then if one decides to change the testing library to JUnit, it is easy to forget about the absence of the 'public' identifier, which causes the tests not to be recognised by IJ. Of course, the solution is to place the 'public' identifiers.

    Although this is not what happened to you it has the same consequence, therefore this answer may help others experiencing the same symptoms.

提交回复
热议问题