I'm writing a REST service which calls external service. I want to write a test for my service. I came up with no possibility to mock this call as it's in managed package. I want to wrap this call with Test.isRunninTest() method. And here is the problem - I can't instantiate a result of this call because... This class doesn't have a constructor. So I want to instantiate it by it's name. Smth like:
System.Type t = mngdpckg.WebServiceClass.ResultSmthCoolExt.class;
result = (mngdpckg.WebServiceClass.ResultSmthCoolExt)t.newInstance();
This code gives me
FATAL_ERROR|MyCoolService.Exception: Error processing transaction: mngdpckg.WebServiceClass.ResultSmthCoolExt does not have a no-arg constructor
Is there any chance I can get this class' instance in a test?