-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Added subproject for configuration-free inline mock making. #920
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
Conversation
Codecov Report
@@ Coverage Diff @@
## release/2.x #920 +/- ##
=================================================
+ Coverage 86.64% 86.71% +0.06%
- Complexity 2244 2350 +106
=================================================
Files 288 291 +3
Lines 5712 5877 +165
Branches 657 673 +16
=================================================
+ Hits 4949 5096 +147
- Misses 574 592 +18
Partials 189 189
Continue to review full report at Codecov.
|
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.
Have not functionally tested it (exams), but I am +1 for the artifact. The more developers adopt the new mock maker, the better!
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.
LGTM to me, I'd just mention the artefact can be discontunued.
subprojects/inline/inline.gradle
Outdated
@@ -0,0 +1,18 @@ | |||
description = "Mockito preconfigured inline mock maker" |
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.
Maybe note this preconfigured mock maker may be discontinued at some point.
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.
Are we sure we want this? For the moment, this is the best alternative. If we removed the artifact, we would probably rather announce it somewhere. It will probably not be before Mockito 3 anyways where people are naturally going through the release notes.
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.
Yes until we find a better way to activate final mocking either explicitly or automatically. I was just advising to mention that in the artefact description.
Ok, added a comment to the description. |
@@ -0,0 +1 @@ | |||
mock-maker-inline |
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.
This will be smallest but most useful jar ever published to central :)
apply from: "$rootDir/gradle/java-library.gradle" | ||
|
||
dependencies { | ||
compile project.rootProject |
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.
When you run build, can you inspect the pom files generated somewhere under the build dir, and make sure the pom has dependencies? We hit this problem in the past twice so far. I will add validation for this caveat at some point.
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.
I checked and the created POM does contain the mockito-core
dependency. Adding verification seems like a good idea!
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.
Absolutely approved!
I have 2 requests:
- verification of created pom (see my comment)
- can you make a note in main Mockito javadoc about this new artifact? Main javadoc already contains mention of the inline mocking so there is a good spot for it already.
Waiting eagerly for out-of-the-box mocking of unmockables!
All done, I added documentation and checked the POM generation! |
W00h00! |
Added a preconfiguration for using the inline mock maker as a convenience artifact that can be included instead of creating the plugin file. This is very helpful when creating multi-module projects where the mock maker file has to repeated many times.
Once we choose to change the mock maker to be default or enable programmatic access, we can decide to drop this artifact similar to
mockito-all
from version one.