The following post partly answers my question except from the fact that my class under test is using several other independent classes and I would like to mock all of them.
JUnit. Mockito. Mock class in class under test
I could inject each of the classes, but I think it's ugly. I could make a generic factory that can instantiate classes of any kind, but I don't want this factory to depend on several different classes because it seems ugly too.
Some input would be very much appreciated. Thanks.
Btw. the project is written in C++.