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

Backport fixes from release/2.x to master #1220

Merged
merged 40 commits into from Oct 22, 2017
Merged

Backport fixes from release/2.x to master #1220

merged 40 commits into from Oct 22, 2017

Conversation

TimvdLippe
Copy link
Contributor

Because we should do this more frequent 😂

mockitoguy and others added 30 commits October 8, 2017 08:29
- While working on new verification started listeners (#1191) I found an instance of incorrect documentation. I added unit tests and simplified the documentation.
- Currently, we do guarantee the order in which invocation listeners get notified. Some of our users might have started to depend on this behavior. I added unit tests and fixed the Javadoc. In general, it is seems useful to guarantee the order. This way, the API is more predictable, easier to use.
- For design and rationale, see #1191
- For all the details, see Javadoc in VerificationStartedListener
Also improved test coverage
- improved test coverage
- reduced code duplication
- Avoided unnecessary calls to mockMaker.getHandler()
- Added a way to avoid this problem in the future
Also renamed the method on the Reporter so that it is more generic
The goal is to make tests easier to read. In the new place, it is easier to cleanly write coverage for this behavior.
Preserved current behavior based on code review feedback. Thanks!
In the event that the user passes a mock with a wrong type, let's fail early. Also added missing coverage.
In the event that the user passes a mock with a wrong type, let's fail early with graceful exception message. Also added missing coverage.
Added context what is the received parameter. Should be helpful when debugging.
- Instead of MockitoMock, we can simply use our public API: MockingDetails. It allows us to reuse / dogfood our public API and have cleaner codebase.
- Added new public API: mockingDetails.getMock(). I needed it to implement APIs for Spring Boot integration. Plus, it just make sense to add this method to make MockingDetails type more complete.
We strive to add top level documentation for every new feature added to Mockito.
Fixed documentation issue, added unit tests
Added experimental API for spring-boot use case
[ci maven-central-release]
Since it is a bigger change sent to Maven Central, I manually edited the release notes.
[ci skip]
Updated my GitHub user name from 'szczepiq' to 'mockitoguy'
Updated my GitHub user name
Fix JUnit imports throughout the project to use the standard
org.junit.Assert assertions instead of the obsolete
junit.framework.TestCase assertions which just delegate to Assert's
methods.
shipkit-org and others added 10 commits October 20, 2017 12:10
* Verify FriendlyReminderException messages

Use the ExpectedException @rule in order to verify the messages it
tests that check FriendlyReminderExceptions to enhance the test.
As a side bonus, this patch cleans up the code with a standard way of
testing exception instead of boiler-plate implement try-fail-catch
structures.

* Import static methods from org.junit.Assert

The de-facto standard of Mockito's test is to use statically imported
methods from the org.junit.Assert class.

This patch changes the few places that import Assert and use its
methods to statically import them in order to standardize the
codebase and make it easier to maintain.
Fixes #1183: Make override check more forgiving to accomondate Kotlin compile patterns.
Adresses #1206: allow opting out from annotation copying within mocks.
Updated Byte Buddy and ASM dependencies. Fixes #1215.
@codecov-io
Copy link

codecov-io commented Oct 22, 2017

Codecov Report

Merging #1220 into master will increase coverage by 0.03%.
The diff coverage is 92.13%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1220      +/-   ##
============================================
+ Coverage     87.29%   87.32%   +0.03%     
- Complexity     2291     2304      +13     
============================================
  Files           286      287       +1     
  Lines          5815     5879      +64     
  Branches        696      709      +13     
============================================
+ Hits           5076     5134      +58     
- Misses          551      553       +2     
- Partials        188      192       +4
Impacted Files Coverage Δ Complexity Δ
.../main/java/org/mockito/internal/util/MockUtil.java 93.1% <ø> (ø) 19 <0> (ø) ⬇️
src/main/java/org/mockito/Mockito.java 96.66% <ø> (ø) 40 <0> (ø) ⬇️
...ava/org/mockito/internal/stubbing/StubberImpl.java 86.36% <100%> (ø) 19 <0> (ø) ⬇️
...kito/internal/creation/bytebuddy/MockFeatures.java 100% <100%> (ø) 2 <2> (ø) ⬇️
.../creation/bytebuddy/SubclassBytecodeGenerator.java 94.73% <100%> (+0.29%) 22 <0> (+2) ⬆️
...rc/main/java/org/mockito/internal/MockitoCore.java 97.95% <100%> (+0.08%) 37 <0> (ø) ⬇️
...rg/mockito/internal/creation/MockSettingsImpl.java 92.77% <100%> (+0.77%) 43 <6> (+4) ⬆️
...g/mockito/internal/util/DefaultMockingDetails.java 100% <100%> (ø) 14 <1> (+1) ⬆️
...java/org/mockito/internal/exceptions/Reporter.java 92.74% <100%> (ø) 94 <1> (ø) ⬇️
...o/internal/creation/settings/CreationSettings.java 97.77% <100%> (+0.21%) 21 <2> (+2) ⬆️
... and 7 more

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 296b760...7cbfd9f. Read the comment docs.

@TimvdLippe TimvdLippe merged commit 79a090d into master Oct 22, 2017
@TimvdLippe TimvdLippe deleted the backport-fixes branch October 22, 2017 16:28
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

6 participants