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

The following examples show how to use org.mockito.internal.verification.VerificationModeFactory#only() . 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: Timeout.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
public VerificationMode only() {
    return new Timeout(impl.getTreshhold(), impl.getTimeout(), VerificationModeFactory.only());
}
 
Example 2
Source File: Mockito.java    From astor with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Allows checking if given method was the only one invoked. E.g:
 * <pre>
 *   verify(mock, only()).someMethod();
 *   //above is a shorthand for following 2 lines of code:
 *   verify(mock).someMethod();
 *   verifyNoMoreInvocations(mock);
 * </pre>
 * 
 * <p>
 * See also {@link Mockito#verifyNoMoreInteractions(Object...)}
 * <p>
 * See examples in javadoc for {@link Mockito} class
 * 
 * @return verification mode
 */
//TODO make exception message nicer
public static VerificationMode only() {
	return VerificationModeFactory.only();
}
 
Example 3
Source File: Mockito.java    From astor with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Allows checking if given method was the only one invoked. E.g:
 * <pre class="code"><code class="java">
 *   verify(mock, only()).someMethod();
 *   //above is a shorthand for following 2 lines of code:
 *   verify(mock).someMethod();
 *   verifyNoMoreInvocations(mock);
 * </code></pre>
 * 
 * <p>
 * See also {@link Mockito#verifyNoMoreInteractions(Object...)}
 * <p>
 * See examples in javadoc for {@link Mockito} class
 * 
 * @return verification mode
 */
public static VerificationMode only() {
	return VerificationModeFactory.only();
}