This question is self explanatory if you know how to use JMockit: How do I mock a method that has generics on it? I want to mock this method: public T save(T entity) but it always throws an exception like this:
mockit.RealMethodNotFoundForMockException: Corresponding real methods not found for the following mocks:
Object save(Object)
at mockit.internal.RedefinitionEngine.modifyRealClass(RedefinitionEngine.java:130)
at mockit.internal.RedefinitionEngine.modifyRealClass(RedefinitionEngine.java:88)
at mockit.internal.RedefinitionEngine.redefineMethods(RedefinitionEngine.java:72)
at mockit.Mockit.setUpMocks(Mockit.java:197)
at com.mytest.MyTest.setUp(AdminManagerImplTest.java:83)