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

[HUDI-798] Migrate to Mockito Jupiter for JUnit 5 #1521

Merged
merged 1 commit into from
Apr 16, 2020

Conversation

xushiyan
Copy link
Member

@xushiyan xushiyan commented Apr 16, 2020

  • Remove old mockito dependency
  • Add mockito-junit-jupiter

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.

Copy link
Member Author

@xushiyan xushiyan left a 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. 🙏

Comment on lines -73 to +72
import static org.mockito.Matchers.anyObject;
import static org.mockito.ArgumentMatchers.any;
Copy link
Member Author

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

Comment on lines -89 to +81
doNothing().when(out).writeByte(anyByte());
doNothing().when(out).writeByte(anyInt());
Copy link
Member Author

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.

Comment on lines -143 to +135
byte[] bytes = invocation.getArgumentAt(0, byte[].class);
byte[] bytes = invocation.getArgument(0);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yanghua yanghua self-requested a review April 16, 2020 06:53
@yanghua yanghua self-assigned this Apr 16, 2020
Copy link
Contributor

@yanghua yanghua left a 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.

@yanghua yanghua merged commit acdc4a8 into apache:master Apr 16, 2020
@xushiyan xushiyan deleted the migrate-mockito branch April 17, 2020 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants