Skip to content

Conversation

raphw
Copy link
Member

@raphw raphw commented Jan 31, 2017

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.

@codecov-io
Copy link

codecov-io commented Jan 31, 2017

Codecov Report

Merging #920 into release/2.x will increase coverage by 0.06%.

@@                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
Impacted Files Coverage Δ Complexity Δ
src/main/java/org/mockito/Mockito.java 96.55% <ø> (ø) 39 <ø> (ø)
...ions/verification/junit/ArgumentsAreDifferent.java 71.42% <ø> (-6.35%) 3% <ø> (+1%)
...ockito/internal/matchers/text/MatcherToString.java 86.66% <ø> (-3.34%) 8% <ø> (+4%)
...java/org/mockito/internal/exceptions/Reporter.java 91.47% <ø> (-0.2%) 176% <ø> (+88%)
...exceptions/verification/ArgumentsAreDifferent.java 0% <ø> (ø) 0% <ø> (ø)
...n/java/org/mockito/internal/util/StringJoiner.java 87.5% <ø> (ø) 3% <ø> (?)
...ava/org/mockito/internal/util/RemoveFirstLine.java 100% <ø> (ø) 2% <ø> (?)
...in/java/org/mockito/internal/util/Decamelizer.java 93.75% <ø> (ø) 7% <ø> (?)
...o/exceptions/verification/WantedButNotInvoked.java 80% <ø> (+13.33%) 2% <ø> (+1%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fcb257b...5aa19dd. Read the comment docs.

Copy link
Contributor

@TimvdLippe TimvdLippe left a 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!

Copy link
Contributor

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

@@ -0,0 +1,18 @@
description = "Mockito preconfigured inline mock maker"
Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Contributor

@bric3 bric3 Feb 1, 2017

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.

@raphw
Copy link
Member Author

raphw commented Feb 1, 2017

Ok, added a comment to the description.

@@ -0,0 +1 @@
mock-maker-inline
Copy link
Member

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
Copy link
Member

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.

Copy link
Member Author

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!

Copy link
Member

@mockitoguy mockitoguy left a 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!

@raphw
Copy link
Member Author

raphw commented Feb 4, 2017

All done, I added documentation and checked the POM generation!

@TimvdLippe
Copy link
Contributor

W00h00!

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.

5 participants