@Before
public void setup() {
service = new PersonService();
dao = mock(PersonDao.class);
//service.setPersonDao(dao); --> How to proceed here as there is no setter
}
}

How to mock the dao object which contains entitymanager, there is no setter for DAO in PersonService
only we have @Inject similarly we dont have setter for entitymanager we have @inject there also.
Please clarify how we can create a Mock for DAO class and set the expectations? Any examples or links are
highly appreciated.