I generally aim for 100%
test coverage (when speaking about the union of unit, integration, and acceptance tests). I generally try to get close to 100% for the unit tests alone as well; however there are times when it doesn't seem useful.
Currently I'm bumping into one of those boundary places.
I have code in a Repository like
Which doesn't seem to be unit testable (easily integration testable using DbUnit, however).
Most of my unit tests in the repository are probably a little towards the "silly" end of things -- typically mocking out the entityManager and just making sure that the right transforms of the incoming arguments are proxied through. At times there is more important logic that needs to be tracked.
Is there a useful way of unit testing the above function? Is there a suggested refactoring to the Repository class to allow better testability in this case?