我不确定是否可以这样做,但是我需要根据测试调用不同的@Before方法。是否有可能为此制定一些解决方案?Junit Jmock测试:用于测试的多个@Before
@Before
performBeforeOne();
@Before
performBeforeTwo();
@Test
callBeforeOneAndExecuteTestOne();
@Test
callBeforeTwoAndExecuteTestTwo();
或者我应该只是创建几个方法,并从每个测试手动调用它们?
尽管您可以拥有多个@Before方法。你不能保证他们运行的顺序。 – JamesB
谢谢,我忘了没有命令:(。 –