Mocking an API response type : <p>I have function which accepts an Oracle Jolt ServletResult. I'm looking to unit test this function to verify that it correctly uses the data that it's been passed.  ServletResult has a protected Constructor and the objects seem to be created internally in Jolt by a Factory. </p>

<p>I've tried Mocking the ServletResult, but that almost requires re-implementing it. The other option I was thinking about was using reflection to create the object. It seems though that Spring ReflectionTestUtils doesn't seem to handle constructors. </p>

<p>What is the best way to deal with this sort of thing? Should such tests just be left to integration testing rather than unit testing? </p>
