/** * 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 */ //TODO make exception message nicer public static VerificationMode only() { return VerificationModeFactory.only(); }
public VerificationMode only() { return copySelfWithNewVerificationMode(VerificationModeFactory.only()); }
/** * 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 */ @CheckReturnValue public static VerificationMode only() { return VerificationModeFactory.only(); }
/** * See the javadoc for {@link VerificationWithTimeout} */ public VerificationMode only() { return new Timeout(impl.getTreshhold(), impl.getTimeout(), VerificationModeFactory.only()); }
/** * 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(); }
/** * See the javadoc for {@link VerificationWithTimeout} */ public VerificationMode only() { return new Timeout(impl.getTreshhold(), impl.getTimeout(), VerificationModeFactory.only()); }