Along with the possibility of simulating the particular behavior of dependencies in test methods, mocking allows us to verify whether specific functions of the mocked objects were invoked. In this recipe, we are going to write a unit tests for a simple registration-form controller. The registration form contains two internal dependencies that we are going to mock using the Mockito Kotlin library. We are going to test whether the proper functions are being invoked in different scenarios.
Verifying function invocations
Getting ready
We are going to use the JUnit library to provide a core framework for running test-case classes. We need to add it to our project's list of project dependencies by declaring it in the gradle...