Csh*_*hah 7 java testing constructor mockito
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 ?
Mockito使用CGLib生成类对象.但是为了实例化这个类对象,它使用了Objenesis http://objenesis.org/tutorial.html
Objenesis能够使用各种技术(即调用ObjectStream.readObject等)在没有构造函数的情况下实例化对象.