When i create a mock object of say class Employee. It doesnt call the constructor of Employee object. I know internally Mockito uses CGLIb and reflection, creates a proxy class that extends the class to mock. If it doesnt call the constructor of employee how is the mock instance of employee class created ?
Share
Mockito uses CGLib to generate class object. However to instantiate this class object it uses Objenesis http://objenesis.org/tutorial.html
Objenesis is able to instantiate object without constructor using various techniques (i.e. calling ObjectStream.readObject and similar).