I just prefer to abstract when I have more reasons that just testing. That can be done using mocking techniques.
https://docs.spring.io/spring/docs/2.5.x/javadoc-api/org/spr...