I have implemented a Java class that performs calls to an interface that I will call "TheInterface".

To unit test my program, I need a mock implementation of TheInterface that I can make my class call. I then need to check whether my class called TheInterface with the correct parameters.


  • Can create mocks dynamically, eliminating the need to write mock classes manually
  • Syntax as short and understandable as possible
  • Make it easy to assert what the call's parameters were
  • Can be configured to log all calls
  • Any method of TheInterface can be dynamically set to return a given result or exception, potentially depending on the call parameters
  • Compatible with JUnit
  • Open source

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.