Using Mockito or another similar framework. Is there a way to mock a package-private class? I am trying to test my service layer mocking my DAO classes. The problem is that the DAO instances are package private and only can be obtained through a factory.
MyPackagePrivateDao mockedDao = mock(MyPackagePrivateDao.class);
The compiler says that the class cannot be accessed from outside the package. Do you have any example?
Thanks