, , .
Java
(MockElephant), , makeNoise, . , , makeNoise
, , MockElephant , . , . . , , . Mocking frameworks , .
, Partial Mocking, , ( ).
Normal Mocks, ( ).
Here you must enter Logger as a dependency. For example, you can create an additional constructor that allows you to provide Logger. In your test, you would use the ridiculous Logger, which again counts its invocations, probably together with the received parameter, and checks that it has the expected values.
Again, you can do this with the Mocking Framework or with plain old Java.
source
share