Hello,
I have the following situation:
public class ClassToMock {
public ClassToMock(AnAbstractDependency d) { ... }
...
}
public abstract class AnAbstractDependency {
public AnAbstractDependency(/*More Dependences*/ ...) { ... }
...
}
public abstract class TestDependency extends AnAbstractDependency {
...
}
// In my test class:
public void testSomething() {
TestDependency testDependency = ...;
ClassToMock mock = AndroidMock.createStrictMock(ClassToMock.class, testDependency);
}
If I run my tests, I get an:
java.lang.IllegalArgumentException: Could not find the specified Constructor: [...]
I don't understand why i get this Exception because there is an matching constructor. Ok, it's a derivative of this class, but why is this a problem?
Or is there anyway to tell AndroidMock, that I don't care about that he find correct constructor?
(I don't want to mock AnAbstractDependency because it then I have to mock more dependences, that I don't need. And to add an addtional constructor only for testing is bad.)
Thanks,
Sven