An exception can be thrown even after an unintended update. Mockito’s never() verification mode checks that a specified method on a mock was not called. section 15.2
Prevent updates after a transfer error
When a transfer’s destination account is missing, assert that the call throws AccountNotFoundException, then verify(accountRepository, never()).changeAmount(anyLong(), any()). The test fails if changeAmount() was called. section 15.2
