Java Code Examples for org.mockito.internal.verification.VerificationModeFactory#atLeast()

The following examples show how to use org.mockito.internal.verification.VerificationModeFactory#atLeast() . 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 File: AtLeastTest.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
@Test
public void shouldNotAllowNegativeNumberOfMinimumInvocations() throws Exception {
    try {
        VerificationModeFactory.atLeast(-50);
        fail();
    } catch (MockitoException e) {
        assertEquals("Negative value is not allowed here", e.getMessage());
    }
}
 
Example 2
Source File: AtLeastTest.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
@Test
public void shouldNotAllowNegativeNumberOfMinimumInvocations() throws Exception {
    try {
        VerificationModeFactory.atLeast(-50);
        fail();
    } catch (MockitoException e) {
        assertEquals("Negative value is not allowed here", e.getMessage());
    }
}
 
Example 3
Source File: Timeout.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
public VerificationMode atLeast(int minNumberOfInvocations) {
    return new Timeout(impl.getTreshhold(), impl.getTimeout(), VerificationModeFactory.atLeast(minNumberOfInvocations));
}
 
Example 4
Source File: AtLeastTest.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
@Test
public void shouldAllowZeroInvocations() throws Exception {
    VerificationModeFactory.atLeast(0);
}
 
Example 5
Source File: AtLeastTest.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
@Test
public void shouldAllowZeroInvocations() throws Exception {
    VerificationModeFactory.atLeast(0);
}
 
Example 6
Source File: Mockito.java    From astor with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Allows at-least-x verification. E.g:
 * <pre>
 *   verify(mock, atLeast(3)).someMethod("some arg");
 * </pre>
 * 
 * See examples in javadoc for {@link Mockito} class
 * 
 * @param minNumberOfInvocations minimum number of invocations 
 * 
 * @return verification mode
 */
public static VerificationMode atLeast(int minNumberOfInvocations) {
    return VerificationModeFactory.atLeast(minNumberOfInvocations);
}
 
Example 7
Source File: Mockito.java    From astor with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Allows at-least-x verification. E.g:
 * <pre class="code"><code class="java">
 *   verify(mock, atLeast(3)).someMethod("some arg");
 * </code></pre>
 * 
 * See examples in javadoc for {@link Mockito} class
 * 
 * @param minNumberOfInvocations minimum number of invocations 
 * 
 * @return verification mode
 */
public static VerificationMode atLeast(int minNumberOfInvocations) {
    return VerificationModeFactory.atLeast(minNumberOfInvocations);
}