@PrepareForTest(ClassWithStaticMethods.class)
@RunWith(PowerMockRunner.class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING) //无效
public class MyTestingClass extends SomeTestBaseClass{
@BeforeClass
public static void init() throws Exception{
//mocking the FacesContext and others
}
@Test
public void testAll(){
this.test0001Create();
this.test0002Edit();
this.test0003Delete();
}
public void test0001Create(){}
public void test0002Edit(){}
public void test0003Delete(){}
}
powermock与junit的fixOrder不兼容,解决方式为testAll
最新推荐文章于 2024-05-27 17:37:29 发布