Specifying an order to junit 4 tests at the Method level (not class level)

前端 未结 6 2170
醉酒成梦
醉酒成梦 2020-12-02 10:50

I know this is bad practice, but it needs to be done, or I\'ll need to switch to testng. Is there a way, similar to JUnit 3\'s testSuite, to specify the order o

6条回答
  •  生来不讨喜
    2020-12-02 11:23

    Using junit 4.11 the new annotation @FixMethodOrder allows to set a specific order:

    @FixMethodOrder(MethodSorters.NAME_ASCENDING)
    

提交回复
热议问题