Search in sources :

Example 1 with OngoingStubbing

use of org.mockito.stubbing.OngoingStubbing in project mockito by mockito.

the class MockitoCore method when.

public <T> OngoingStubbing<T> when(T methodCall) {
    MockingProgress mockingProgress = mockingProgress();
    mockingProgress.stubbingStarted();
    @SuppressWarnings("unchecked") OngoingStubbing<T> stubbing = (OngoingStubbing<T>) mockingProgress.pullOngoingStubbing();
    if (stubbing == null) {
        mockingProgress.reset();
        throw missingMethodInvocation();
    }
    return stubbing;
}
Also used : OngoingStubbing(org.mockito.stubbing.OngoingStubbing) MockingProgress(org.mockito.internal.progress.MockingProgress)

Aggregations

MockingProgress (org.mockito.internal.progress.MockingProgress)1 OngoingStubbing (org.mockito.stubbing.OngoingStubbing)1