4

I tried to use PowerMockRule in a JUnit test that uses arquillian but I get java.lang.ExceptionInInitializerError Caused by: java.lang.IllegalStateException: PowerMockRule can only be used with the system classloader but was loaded by ModuleClassLoader for Module

I want to test something like this:

 @RunWith(Arquillian.class)
 @PrepareForTest(WARRRAworkffsTest.class)
 public class WARRRAworkffsTest  {

@Rule  
   public PowerMockRule rule = new PowerMockRule();  


   @Deployment(testable=true)
        public static EnterpriseArchive createDeployment() throws MalformedURLException {

// yadayada

return ear;


}


@Test
public void createTest(){
PowerMock usage
}

}

Can you help me to solve this? Or if you have another idea how should i do it, will be great.

  • I was not able to get it up and running, but have a look at this: http://stackoverflow.com/questions/9496552/using-both-arquillian-and-powermock-in-the-same-junit-test – MeBNoah Jun 18 '15 at 15:49
  • 1
    @Adelina Dimachi: Did you got it? I have the same problem. Your linked post does not help either. – badera May 12 '16 at 14:14

0 Answers0