use of org.mockito.internal.progress.MockingProgress in project mockito by mockito.
the class MockedStaticImpl method reset.
@Override
public void reset() {
assertNotClosed();
MockingProgress mockingProgress = mockingProgress();
mockingProgress.validateState();
mockingProgress.reset();
mockingProgress.resetOngoingStubbing();
resetMock(control.getType());
}
use of org.mockito.internal.progress.MockingProgress in project mockito by mockito.
the class MockedStaticImpl method when.
@Override
public <S> OngoingStubbing<S> when(Verification verification) {
assertNotClosed();
try {
verification.apply();
} catch (MockitoException exception) {
throw exception;
} catch (Throwable ignored) {
}
MockingProgress mockingProgress = mockingProgress();
mockingProgress.stubbingStarted();
@SuppressWarnings("unchecked") OngoingStubbing<S> stubbing = (OngoingStubbing<S>) mockingProgress.pullOngoingStubbing();
if (stubbing == null) {
mockingProgress.reset();
throw missingMethodInvocation();
}
return stubbing;
}
use of org.mockito.internal.progress.MockingProgress in project mockito by mockito.
the class MockitoCore method stubber.
public Stubber stubber() {
MockingProgress mockingProgress = mockingProgress();
mockingProgress.stubbingStarted();
mockingProgress.resetOngoingStubbing();
return new StubberImpl();
}
use of org.mockito.internal.progress.MockingProgress in project mockito by mockito.
the class MockitoCore method reset.
public <T> void reset(T... mocks) {
MockingProgress mockingProgress = mockingProgress();
mockingProgress.validateState();
mockingProgress.reset();
mockingProgress.resetOngoingStubbing();
for (T m : mocks) {
resetMock(m);
}
}
use of org.mockito.internal.progress.MockingProgress in project mockito by mockito.
the class MockitoCore method stubber.
public Stubber stubber(Strictness strictness) {
MockingProgress mockingProgress = mockingProgress();
mockingProgress.stubbingStarted();
mockingProgress.resetOngoingStubbing();
return new StubberImpl(strictness);
}
Aggregations