I'm trying to write a Test class to test a Scheduled flow. However I'm not sure how to call this flow. :/
I've tried the following on the my testMethod
@isTest
static void testMethod1(){
Test.startTest();
Flow.Interview myFlow = flow.Interview.createInterview('Flow Name', New Map<String,string>());
myFlow.start();
Test.stopTest();
}
However, I get the following error:
FATAL_ERROR System.FlowException: The flow failed to start because the provided values were not valid:
You can't launch a schedule-triggered flow by clicking Run in Flow Builder. To test this flow,
click Debug and then Run. To launch this flow, activate the flow and wait until the scheduled time.
Has anyone found a way of testing a scheduled flow?
Thanks