Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information