-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[HUDI-798] Migrate to Mockito Jupiter for JUnit 5 #1521
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yanghua @vinothchandar Please kindly review this to enable Junit 5 adoption for other PRs. 🙏
import static org.mockito.Matchers.anyObject; | ||
import static org.mockito.ArgumentMatchers.any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
anyObject is deprecated... any is the alias
doNothing().when(out).writeByte(anyByte()); | ||
doNothing().when(out).writeByte(anyInt()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
writeByte() actually takes an int.. so strict stubbing requires an int for this.
byte[] bytes = invocation.getArgumentAt(0, byte[].class); | ||
byte[] bytes = invocation.getArgument(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the new API refers getArgument()
https://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/invocation/InvocationOnMock.html#getArgument-int-
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xushiyan Thanks for your contribution. LGTM.
Committer checklist
Has a corresponding JIRA in PR title & commit
Commit message is descriptive of the change
CI is green
Necessary doc changes done or have another open PR
For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.