Methods of Mockito - Javatpoint
In the above code, thenReturn() is mostly used with the when() method. Mockito verify() method. The verify() method is used to check whether some specified methods are called or not. In simple terms, it validates the certain behavior that happened once in a test. It is used at the bottom of the testing code to assure that the defined methods are called.