Mockito.spy() will not work with cglib-enhanced objects

Mockito.spy() will not work with cglib-enhanced objects , even if you use doReturn() instead of thenReturn().

This can cause problems in spring + @Transactional + cblig situations.

As a result, you can’t simply use @Transactional in your code, but use TransactionTemplate, or create one interface/one implementation for every class that maybe mocked in integration tests