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 unchecked warnings when calling Mockito.mock(Class) #4413

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on May 6, 2024

  1. Fixes unchecked warnings when calling Mockito.mock(Class)

    This is an issue well known by the Mockito community, but prone to not
    be fixed:
    mockito/mockito#1531
    
    Generics allow to ensure type-safety at compile time instead of runtime.
    However, here it is used mainly to auto-cast the created object, thus
    avoiding this burden on the developer. Indeed, it is in a context where
    type safety is usually not a requirement, since the use of this method
    is often the most trivial we can have: provide a class and expect a very
    instance of this class in return.
    
    This commit thus creates a less constrained mock method which builds on
    Mockito's one, but without the constraint inducing this warning.
    matthieu-vergne committed May 6, 2024
    Configuration menu
    Copy the full SHA
    0309e91 View commit details
    Browse the repository at this point in the history

Commits on May 7, 2024

  1. Configuration menu
    Copy the full SHA
    a38936d View commit details
    Browse the repository at this point in the history