You need to sign in to do that
Don't have an account?
James Billings
Get class name of queueable implementation
I'm writing some tests for a class which can trigger a couple of different queueables.
In the tests, we have a mock implementaion of ISystemOperation which increments a number when a call to enqueue is made...
I now want to only increment the counter when the expected queueable class is used, but I cannot find out a way of getting this... Example (pseudo)code, the line marked with **** is the one I'm wondering how to implement:
private class CapturingSystemOperation implements ISystemOperation { public Integer CallCount = 0; public String expectedClassName; public String enqueueJob(Queueable queueableClass) { ********if (queueableClass.class.Name == expectedClassName) { CallCount++; } return Utils.getFakeId(AsyncApexJob.SObjectType); } }
Any ideas?
The string represention includes jsonified data passed to the class too, so grabbing everything before the first ":" gives just the class name