Java Code Examples for org.mockito.Mockito#times()

The following examples show how to use org.mockito.Mockito#times() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: mockito-java8   File: WithMockito.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * Delegates call to {@link Mockito#times(int)}.
 */
default VerificationMode times(int wantedNumberOfInvocations) {
    return Mockito.times(wantedNumberOfInvocations);
}
 
Example 2
/**
 * Verifies that execute is called exactly one time with a argument that matches the specified
 * matcher.
 *
 * @param wantedArgument a {@link RestClientCallArgumentMatcher} to specify the expected argument
 * @param wantedNumberOfInvocations expected number of invocations
 * @throws IOException
 */
public void verifyExecute(
    RestClientCallArgumentMatcher wantedArgument, int wantedNumberOfInvocations)
    throws IOException {
  VerificationMode times = Mockito.times(wantedNumberOfInvocations);
  verifyExecute(wantedArgument, times);
}