Getting java.lang.IllegalAccessError while mocking
my Class constructor looks like.
public Acct(java.lang.Class _javaType,
javax.xml.namespace.Qname _xmlType,
com.ibm.ws.webservices.engine.description.TypeDesc _typeDesc){
super(_javaType,_xmlType,_typeDesc);
}
i tried mocking like this.
public class AcctTest extends PowerMockito{
@Test
public void testMethod(){
java.lang.Class jType = PowerMock.mock(java.lang.Class.class);
javax.xml.namespace.Qname xml = PowerMock.mock(javax.xml.namespace.Qname.class);
com.ibm.ws.webservices.engine.description.TypeDesc Desc = PowerMock.mock(com.ibm.ws.webservices.engine.description.TypeDesc.class);
//Object creation to access constructor
}
}
Exception:
java.lang.IllegalAccessError: java.lang.Class
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
Looks like it is not able to access predefined java types. thanks
can someone please guide, how to mock such objects?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…