I am new to Mockito, following this and am trying to find out what verify method does. It seems it is used to make sure the selected method is called once. I have the following code, and by looking at the code I can find out I am calling addBook method twice so why should I use verify? I mean in any case it is easy to make sure a method is called oncem so why should we use verify method?
String isbn = mockedBookDAL.addBook(book1);
assertNotNull(isbn);
isbn = mockedBookDAL.addBook(book1);
assertNotNull(isbn);
verify(mockedBookDAL).addBook(book1);
assertEquals(book1.getIsbn(), isbn);