void function ( ) { repository . findById ( 1L ) ; verify ( repository ) . findById ( 1L ) ; }
this test demonstrates how we can ensure that a method was called once with the correct method parameters . note : we should n't verify interactions between system under test and our test double if the method is a finder method . concode_field_sep TaskRepository repository concode_field_sep void verifyThatMethodOfSpyWasNotInvoked concode_elem_sep void verifyWhenMethodWasCalledOnceWithoutUsingTheShortCut concode_elem_sep void verifyThatNoOtherMethodsWereInvoked concode_elem_sep void verifyThatMethodWasInvokedByAnd1LWasUsedAsMethodParameter concode_elem_sep void verifyThatMethodWasInvokedByUsingArgumentCaptor concode_elem_sep void verifyThatNoInteractionsHappenedBetweenSUTAndSpy concode_elem_sep void createSpy concode_elem_sep void verifyThatMethodWasInvokedAndAnyLongObjectWasUsedAsMethodParameter