How to pre-define the running sequences of junit test cases?

后端 未结 5 1786
无人及你
无人及你 2021-01-11 09:44

I have a test class in java and there are several methods annotated by @Test in it, somehow, i want to Junit run method A before method B when i run the whole tests. Is it p

5条回答
  •  滥情空心
    2021-01-11 10:14

    This sort of dependency on test methods is bad design and should be avoided. If there is initialization code in one test method that needs to be done for the next, it should be factored out into a setUp method.

提交回复
热议问题