Skip to content

Conversation

podarsmarty
Copy link

Fixes #1003: Allow reloading of plugins.

This is done by making the PluginRegistry non final and exposing a public static method in Plugins so that PluginSwitch's in the future can trigger a reload of plugins if it wants to disable/enable some of them.

mockitoguy and others added 30 commits December 20, 2016 15:45
- Makes the behavior of JUnit runner more consistent with JUnit rules. Lack of this consistency was reported by the users.
- In Mockito 3.0 we will make the runner have exactly the same behavior as the rule and the implementation will be reused via MockitoTestListener implementations. Refactored JUnit runner implementation will make it easy.
- The change should be safe. The most critical change is in SilentJUnitRunner - please review this class most carefully.
After some nice feedback from Brice!
Subjective decision. JUnit runner reporting stubbing mismatches is a nice feature!
JUnit runner reports argument stubbing mismatches
It's already included in the interface hierarchy
'Impl' postfix in the interface name is very awkward
Also tweaked existing javadoc
This fixes recently introduced flakiness of the build.
For maintainability
Added missing Javadoc and few other tidy-ups
I'm tired of doing it manually from the Bintray web interface.
Automatically publish main jar to central
I'm tired of doing it manually from the Bintray web interface.
mockitoguy and others added 22 commits March 5, 2017 15:19
Support constructor parameters for spying on abstract classes

Fixes #685
* Fixes #976: Improve constructor choosing

With the current code (introduced in Mockito 2.7.14 by commit
6a82c03), calling MockSettings#useConstructor with an argument list
that would be applicable to more than one constructor would fail with
an org.mockito.internal.creation.instance.InstantiationException.

This behavior, however, is suboptimal, as described in issue #976, as
it makes useConstructor less robust than the Java compiler, which is
able to resolve such ambiguities.
With this patch, Mockito will attempt to match the constructor with
the most specific parameter types. A constructor X is considered more
specific than a constructor Y if:
1. They are both applicable to the given argument list
2. Constructor X has at least one parameter which is a further
   specialization of the corresponding parameter of constructor Y
   (i.e. paramX.isAssignableFrom(paramY)).
3. Constructor Y has no parameter which is a further specialization
   of the corresponding parameter of constructor X, as defined above.

E.g., consider the following class:

    public class SomeClass {
        SomeClass(Object o) {}
        SomeClass(String s) {}
    }

Without this patch, calling

    mock(SomeClass.class, withSettings().useConstructor("string!"))

would fail. With this patch, such a call would invoke the
SomeClass(String) constructor.

* Fix Freudian slip in message regarding issue 685

The text should read "a better JOB", not "a better JOIN".
…979)

* Fixes #974: Add constructors to LocationImpl

* Fixes #974: Add Location parameter to constructor of InterceptedInvocation

* Fixes #974: Add MockMethodInterceptor#doIntercept() to take a Location argument

* Fixes #974: Fix to get correct stubbing location with inline mocking
fix the broken link on 1357 line in Mockito.java

[ci skip-release]
GitHub doesn't seem to render images from URLs with spaces properly,
breaking the release notes badge.
This change encodes the URL, replacing the space with %20 to make it
render properly.

[ci skip]
Fix release notes badge

[ci skip-release]
@codecov-io
Copy link

codecov-io commented Mar 24, 2017

Codecov Report

Merging #1004 into release/2.x will increase coverage by <.01%.
The diff coverage is 100%.

@@                Coverage Diff                @@
##             release/2.x    #1004      +/-   ##
=================================================
+ Coverage          86.86%   86.86%   +<.01%     
- Complexity          2290     2291       +1     
=================================================
  Files                287      287              
  Lines               5801     5803       +2     
  Branches             684      684              
=================================================
+ Hits                5039     5041       +2     
  Misses               571      571              
  Partials             191      191
Impacted Files Coverage Δ Complexity Δ
...ockito/internal/configuration/plugins/Plugins.java 87.5% <100%> (+4.16%) 6 <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 7567f77...6df4994. Read the comment docs.

@podarsmarty
Copy link
Author

oops messed up a script destroyed my repo's git history. fixing it now.

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.