使用PowerMock模拟多个类的静态方法
 我知道如何使用PowerMock从类中嘲讽静态方法。 
 但我想嘲笑使用JUnit和PowerMocktesting类中的多个类的静态方法。 
谁能告诉我是否有可能做到这一点,如何做到这一点?
只要为多个类执行@PrepareForTest({Class1.class,Class2.class}) 。 
 @Test @PrepareForTest({Class1.class, Class2.class}) public final void handleScript() throws Exception { PowerMockito.mockStatic(Class1.class); PowerMockito.mockStatic(Class2.class); 
等等…
  在使用powermock / junit的java中,使用@PrepareForTest({})和所需的静态类作为数组( {} )。 
 @RunWith(PowerMockRunner.class) @PrepareForTest({XmlConverterA.class, XmlConverterB.class}) class TransfersServiceExceptionSpec { } 
我已经在scala / junit中使用了powermock,因为scalatest没有与powermock集成。
 @RunWith(classOf[PowerMockRunner]) @PrepareForTest(Array(classOf[XmlConverterA], classOf[XmlConverterB])) class TransfersServiceExceptionSpec { @Test def test() { } }