Bug 562639

Summary: Add import static org.mockito.Mockito.*; to favorites in JDT
Product: [Eclipse Project] JDT Reporter: Lars Vogel <Lars.Vogel>
Component: UIAssignee: Lars Vogel <Lars.Vogel>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: gautier.desaintmartinlacaze, Lars.Vogel, noopur_gupta, pyvesdev
Version: 4.14Keywords: usability
Target Milestone: 4.19 M2   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/175431
https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=4af93e11ef4bf764914a43712d8abe62bef26b11
https://bugs.eclipse.org/bugs/show_bug.cgi?id=511443
https://git.eclipse.org/r/c/www.eclipse.org/eclipse/news/+/175441
https://git.eclipse.org/c/www.eclipse.org/eclipse/news.git/commit/?id=8313de2bf6e02693a9eeb4d167ef2a3413a1b59a
https://bugs.eclipse.org/bugs/show_bug.cgi?id=575246
Whiteboard:
Bug Depends on:    
Bug Blocks: 569282    

Description Lars Vogel CLA 2020-04-30 02:34:36 EDT
Mockito is a very popular test framework and IDE like IntelliJ provide quickfixes and code completion out of the box for them. Can we add org.mockito.Mockito.*; to our default favorites in JDT? This would give a similar experience in Eclipse as in IntelliJ. And AFAIK adding this does not create issues for the user, even if he does not use Mockito.
Comment 1 Lars Vogel CLA 2020-04-30 02:34:59 EDT
Noopur, WDYT?
Comment 2 Noopur Gupta CLA 2020-05-04 04:33:43 EDT
It will be OK to add a new favorite if there's a demand but I haven't seen any other bug request to add Mockito yet.

Also, it should be checked which classes/packages from Mockito are desired most frequently and only those should be added to favorites.
Comment 3 Lars Vogel CLA 2021-01-28 04:51:21 EST
(In reply to Noopur Gupta from comment #2)
> It will be OK to add a new favorite if there's a demand but I haven't seen
> any other bug request to add Mockito yet.
> 
> Also, it should be checked which classes/packages from Mockito are desired
> most frequently and only those should be added to favorites.

org.mockito.Mockito.* seems to be the big win. I'm delivering a JUnit / Mockito, etc. training to a customer and that one would make already a big difference.
Comment 4 Eclipse Genie CLA 2021-01-28 04:54:38 EST
New Gerrit change created: https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/175431
Comment 6 Noopur Gupta CLA 2021-01-28 07:31:31 EST
Thanks for the patch, Lars. Please verify it in the next build and add an N&N entry.
Comment 7 Eclipse Genie CLA 2021-01-28 08:22:17 EST
New Gerrit change created: https://git.eclipse.org/r/c/www.eclipse.org/eclipse/news/+/175441
Comment 9 Pierre-Yves Bigourdan CLA 2021-01-28 14:05:24 EST
Thanks for adding this, it will be handy for me as well!
Comment 10 Lars Vogel CLA 2021-01-28 15:23:55 EST
(In reply to Pierre-Yves B. from comment #9)
> Thanks for adding this, it will be handy for me as well!

If you think we should add more Mockito packages, please let us know.
Comment 11 Lars Vogel CLA 2021-08-04 12:59:49 EDT
After writing lots of Mockito tests for a client I noted that org.mockito.ArgumentMatchers.*; is used very frequently. Opened Bug 575246 to add this also.