BS-9484, change the way to spy the object with injected mocks due to a
limitation of mockito