I believe I've found a bug, but I wanted to throw it to the community to see if I'm not understanding something. I'm implementing a test class and using Test.createStub to mock a dependency. The interface being mocked is essentially:
public interface IBatchableFactory {
Database.Batchable<SObject> getBatchable(String someParam);
}
My test method invokes:
public IBatchableFactory setupDependencies() {
StubProvider myStubProvider = new BatchableStubProvider();
IBatchableFactory factStub = (IBatchableFactory) Test.createStub(IBatchableFactory.class, myStubProvider);
return factStub;
}
My test fails on the line creating factStub
.
The error is:
System.TypeException: No type arguments provided for a parameterized type: Database.Batchable
The top of the stack trace is:
Class.System.Test.createStub: line 93, column 1
That's a system method I have no control over! I am 100% confident the problem is not within the stub provider itself, either.
Has anyone ever seen / solved this problem?