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

standardize on one mocking lib (remove jmockit and powermock) #3025

Closed
christophsturm opened this issue Jul 29, 2019 · 7 comments
Closed

standardize on one mocking lib (remove jmockit and powermock) #3025

christophsturm opened this issue Jul 29, 2019 · 7 comments

Comments

@christophsturm
Copy link
Contributor

right now we use 3 different mock libraries: jmockit, mockito, and powermock (with mockito api)

I think we should only use mockito. There probably should be two subtickets for this, one to remove jmockit(probably a quick change), and one to remove powermock (needs architectural changes but also not hard.)

@christophsturm christophsturm changed the title standardize on mocking libs standardize on mocking libs (remove jmockit and powermock) Jul 29, 2019
@christophsturm christophsturm changed the title standardize on mocking libs (remove jmockit and powermock) standardize on one mocking lib (remove jmockit and powermock) Jul 29, 2019
@mrosseel
Copy link
Contributor

What is your reason for chosing mockito?
I've chosen jmockito in the past but no strong opinions

@sqrrm
Copy link
Member

sqrrm commented Jul 29, 2019

@christophsturm I support this. If you drive it and make reasonable decisions it will happen. Previously we've discussed it but there need to be someone actually doing it as well. Perhaps add another issue in https://github.com/bisq-network/style/issues on the topic of mocking as well.

@christophsturm
Copy link
Contributor Author

reasons for mockito:

  • I know mockito best from previous projects, so I know pretty well how to convert all tests to mockito, with jmockit I would have to read up on it.
  • Mockito seems to be the most used mocking lib in java land
  • Our jmockit setup is really complicated, we use 2 different jmockit versions, one in p2p and a different one in the other modules.
  • Jmockit uses an javaagent which not always works so well in the IDE

last reason and for me the main reason: jmockit and powermock both have powerful static mocking methods which mockito does not have by design, and I think simpler mocking enforces better design.

It is possible that not all these reasons are true or still true because i don't know much about jmockit, i just saw that we have a pretty complicated setup.

@blabno
Copy link

blabno commented Jul 31, 2019

This has been discussed here: bisq-network/proposals#74

@christophsturm
Copy link
Contributor Author

ok that proposal seems to mostly agree with my conclusion.

@freimair
Copy link
Contributor

are there still other mocking frameworks in use?

@christophsturm
Copy link
Contributor Author

no this is fixed

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

No branches or pull requests

5 participants