I wonder what do people do in cases like:
I'm writing a test for a service class that depends on a lot of other classes, so I need to build it by passing various mocks to the constructor:
SomeClassUnderTest classUnderTest = new SomeClassUnderTest(dependency1, dependency2, dependency3, ...);
the question is, what is the best way to create everything quickly?
E.g.: I start by typing:
at this point, I'd like to have a quick way to create mocks for all of the parameters, and use them, that is, for each param introduce a mock field in the test such as
@Mock DependencyType1 dependency1; // we use mockito for our mocks, but EasyMock is similar
and use that in the new clause:
then go on (or even do all of them in one go).
Do you guys have a quick solution for this workflow?