-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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
…2968 [ci skip-release]
Added experimental API for spring-boot use case [ci maven-central-release]
…2973 [ci skip-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.
…2987 [ci skip-release]
… compile patterns.
* 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.
…2999 [ci skip-release]
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Because we should do this more frequent 😂