/** * @param expectation * @return * @since 3.1 */ @Override public C expect(Expectation expectation) { checkOpened(); expectations.add(expectation); return self(); }
/** * @param expectation * @return * @since 3.1 */ @Override public C expect(Expectation expectation) { checkOpened(); expectations.add(expectation); return self(); }
/** * Wrapper for {@link Sniffy#spy()} method; useful for chaining * @return a new {@link Spy} instance * @since 2.0 */ public C reset() { checkOpened(); super.reset(); expectations.clear(); return self(); }
/** * Wrapper for {@link Sniffy#spy()} method; useful for chaining * @return a new {@link Spy} instance * @since 2.0 */ public C reset() { checkOpened(); super.reset(); expectations.clear(); return self(); }
/** * @param expectation * @return * @since 3.1 */ @Override public C verify(Expectation expectation) { checkOpened(); expectation.verify(this); return self(); }
/** * @param expectation * @return * @since 3.1 */ @Override public C verify(Expectation expectation) { checkOpened(); expectation.verify(this); return self(); }
/** * Executes the {@link Runnable#run()} method on provided argument and verifies the expectations * @throws SniffyAssertionError if wrong number of queries was executed * @since 2.0 */ public C run(Runnable runnable) throws SniffyAssertionError { checkOpened(); try { runnable.run(); } catch (Throwable e) { throw verifyAndAddToException(e); } verify(); return self(); }
/** * Executes the {@link Runnable#run()} method on provided argument and verifies the expectations * @throws SniffyAssertionError if wrong number of queries was executed * @since 2.0 */ public C run(Runnable runnable) throws SniffyAssertionError { checkOpened(); try { runnable.run(); } catch (Throwable e) { throw verifyAndAddToException(e); } verify(); return self(); }
/** * Executes the {@link io.sniffy.Executable#execute()} method on provided argument and verifies the expectations * @throws SniffyAssertionError if wrong number of queries was executed * @since 3.1 */ @Override public C execute(io.sniffy.Executable executable) throws SniffyAssertionError { checkOpened(); try { executable.execute(); } catch (Throwable e) { throw verifyAndAddToException(e); } verify(); return self(); }
/** * Executes the {@link io.sniffy.Executable#execute()} method on provided argument and verifies the expectations * @throws SniffyAssertionError if wrong number of queries was executed * @since 3.1 */ @Override public C execute(io.sniffy.Executable executable) throws SniffyAssertionError { checkOpened(); try { executable.execute(); } catch (Throwable e) { throw verifyAndAddToException(e); } verify(); return self(); }