/** * Verifies that all trained methods have been invoked on all mock objects (created by {@link * #newMock(Class)}, then switches each mock object back to training mode. */ protected final void verify() { tester.verify(); }
/** * Switches each mock object created by {@link #newMock(Class)} into replay mode (out of the * initial training mode). */ protected final void replay() { tester.replay(); }
/** Discards any mock objects created during the test. */ @AfterMethod(alwaysRun = true) public final void discardMockControl() { tester.cleanup(); }
/** * Creates a new mock object of the indicated type. The shared mock control does * <strong>not</strong> check order, but does fail on any unexpected method invocations. * * @param <T> the type of the mock object * @param mockClass the class to mock * @return the mock object, ready for training */ protected final <T> T newMock(Class<T> mockClass) { return tester.newMock(mockClass); }
/** Returns the {@link IMocksControl} for this thread. */ protected final IMocksControl getMocksControl() { return tester.getMocksControl(); }