views:

81

answers:

0

I have a class under test which says some thing like ClassA a = new ClassA(); In this case, i want it to instantiate ClassB which is a mock of ClassA. I am using Mockit.redefine and restore .. During execution of a.doSomething() I get an error saying java.lang.NoSuchMethodError: ClassB: method ()V not found.. The method signature is matching.

I am able to use Mock it effectively for Static methods like ClassA.doStaticSomething() is properly invoking ClassB.doStaticSomething(). But i am not able to proceed with non static classes.