I think it would be better to avoid stubbing this sort of thing in integration tests.  Can we retain a full end-to-end test for a couple of common cases, and then just move the detailed coverage of the edge cases into the unit tests.