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

automatically detect class to mock #2779

Merged
merged 6 commits into from Nov 14, 2022
Merged

automatically detect class to mock #2779

merged 6 commits into from Nov 14, 2022

Commits on Oct 28, 2022

  1. automatically detect class to mock

    this commit adds method `Mockito.mock()` as a shorter alternative for `Mockito.mock(Class)`. When result of this call is assigned to a variable/field, java will detect the needed class automatically.
    
    P.S. I had to ignore errorprone checks "DoNotMock" and "DoNotMockAutoValue" because they fail with IndexOutOfBoundException trying to get the first argument of `Mockito.mock()`. :)
    asolntsev committed Oct 28, 2022
    Copy the full SHA
    ac2c9f3 View commit details
    Browse the repository at this point in the history

Commits on Nov 13, 2022

  1. Copy the full SHA
    adf07fe View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    2fa44f7 View commit details
    Browse the repository at this point in the history
  3. add parameterless method Mockito.spy()

    ... similarly to `Mockito.mock()`
    asolntsev committed Nov 13, 2022
    Copy the full SHA
    27807bc View commit details
    Browse the repository at this point in the history

Commits on Nov 14, 2022

  1. Update src/main/java/org/mockito/Mockito.java

    Co-authored-by: Tim van der Lippe <TimvdLippe@users.noreply.github.com>
    asolntsev and TimvdLippe committed Nov 14, 2022
    Copy the full SHA
    d903bd6 View commit details
    Browse the repository at this point in the history
  2. Update src/main/java/org/mockito/Mockito.java

    Co-authored-by: Tim van der Lippe <TimvdLippe@users.noreply.github.com>
    asolntsev and TimvdLippe committed Nov 14, 2022
    Copy the full SHA
    7232399 View commit details
    Browse the repository at this point in the history