When building a unit test, is it appropriate to use a mocking tool to assist you in setting up an object even if you will not be mocking any behavior or verifying any interaction with that object?Here is a simple example in pseudo-code://an object we actually want to mockObject someMockedObject = new Mock(Object.class);EqualityChecker checker = new EqualityChecker(someMockedObject);//an object we are stubbing/mocking only to avoid figuring out how to instantiate or //tying ourselves to some constructor that may be removed in the futureComplicatedObject someObjectThatIsHardToInstantiate = new Mock(ComplicatedObject.class);//set the expectation on the mockWhen(someMockedObject).equals(someObjectThatIsHardToInstantiate).return(false);Assert(equalityChecker.check(someObjectThatIsHardToInstantiate)).isFalse();//verify that the mock was interacted with properlyVerify(someMockedObject).equals(someObjectThatIsHardToInstantiate).oneTime();Is it appropriate to mock ComplicatedObject in this scenario?
Using mocks to set up object even if you will not be mocking any behavior or verifying any interaction with it?
mocking