> For the complete documentation index, see [llms.txt](https://notes.tejpratapsingh.com/java-testing/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://notes.tejpratapsingh.com/java-testing/mockito/mockito.verify.md).

# Mockito.verify()

Verify interactions with your mock

Mockito Verify is used to verify interaction of your mock inside your source (System Under Test) code.

We can check if method a is called with our mock, how many times it was called, or it was not called at all.

```java
// Verify interactions
Mockito.verify(mock, Mockito.times(1)).sampleMethod();

// Verify, method should not be invoked even once
Mockito.verify(mock, Mockito.never()).sampleMethod2();
```

Mockito support 2 more verification methods,

* Mockito.verifyNoMoreInteractions()

```java
// Verify, we did not miss any interaction in out test
// If will fail if there are any interaction
// and we did not wrote a verification assertion in our test
Mockito.verifyNoMoreInteractions(otherMockedClass);
```

* Mockito.verifyNoInteractions()

```java
// Verify, our mock did not have any methods called in peice of code we were testing
Mockito.verifyNoInteractions(otherMockedClass);
```
