Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix reversed order of verify parameters #2179

Merged
merged 1 commit into from Jan 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/main/java/org/mockito/MockedStatic.java
Expand Up @@ -35,14 +35,21 @@ public interface MockedStatic<T> extends ScopedMock {
* See {@link Mockito#verify(Object)}.
*/
default void verify(Verification verification) {
verify(times(1), verification);
verify(verification, times(1));
}

/**
* See {@link Mockito#verify(Object, VerificationMode)}.
*
* @deprecated Please use {@link MockedStatic#verify(Verification, VerificationMode) instead
*/
void verify(VerificationMode mode, Verification verification);

/**
* See {@link Mockito#verify(Object, VerificationMode)}.
*/
void verify(Verification verification, VerificationMode mode);

/**
* See {@link Mockito#reset(Object[])}.
*/
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/org/mockito/internal/MockedStaticImpl.java
Expand Up @@ -61,6 +61,11 @@ public <S> OngoingStubbing<S> when(Verification verification) {

@Override
public void verify(VerificationMode mode, Verification verification) {
verify(verification, mode);
}

@Override
public void verify(Verification verification, VerificationMode mode) {
assertNotClosed();

MockingDetails mockingDetails = Mockito.mockingDetails(control.getType());
Expand Down