JUnit and junit.framework.TestSuite - No runnable methods

后端 未结 4 1237
别跟我提以往
别跟我提以往 2020-12-21 00:46

I\'ve made some unit tests (in test class). The tutorial I\'ve read said that I should make a TestSuite for the unittests.

Odd is that when I\'m running the unit tes

4条回答
  •  既然无缘
    2020-12-21 01:34

    Be careful when using an IDE's code-completion to add the import for @Test. It has to be import org.junit.Test and not import org.testng.annotations.Test, for example. If you use the second one by mistake, you'll get the "no runnable methods" error. (I was using Intellij Idea 2017 which imported org.junit.jupiter.api.Test instead!)

提交回复
热议问题