我已经开始测试,现在我想使用@After,@Before但@Test我的应用程序只运行该@Before方法并在控制台上提供输出
前
但是,如果我删除它@After并@Before运行@Test。我的代码在这里:
public class TestPractise extends AbstractTransactionalDataSourceSpringContextTests{
@Before
public void runBare(){
System.out.println("before");
}
@Test
public void testingMethod(){
System.out.println("testing");
}
@After
public void setDirty(){
System.out.println("after");
}
}
为什么不@After,@Test和@before同时工作?