If the JPA service layer injects the entity manager, then you need an app server to test that layer.  Passing it in as a parameter solves that.