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

Fixes #1578: outer class mocks unavailable from inner class #1596

Merged
merged 1 commit into from Jan 31, 2019
Merged

Fixes #1578: outer class mocks unavailable from inner class #1596

merged 1 commit into from Jan 31, 2019

Commits on Jan 31, 2019

  1. Fixes #1578: append mocks to existing MockitoSession

    - Problem - JUnitRule detects an unfinished mocking session when the apply method is invoked more than once.  This commonly happens with Runners that enable developers to write nested test classes.
    - Fix - If a MockitoSession has been established for JUnitRule, then use that and initialize any new mocks (typically from a nested test class).
    - Test - Instantiate one @rule and assign it to a second one.  This will simulate the apply method being invoked more than once without introducing a new test dependency.
    Matthew Ouyang committed Jan 31, 2019
    Configuration menu
    Copy the full SHA
    d9bdfe6 View commit details
    Browse the repository at this point in the history