
Visualforce Page:
<apex:page controller="Quick_Case" >
<flow:interview name="Quick_Case" interview="{!flowInstance}" finishLocation="{!FinishLocation}" buttonLocation="bottom">
<apex:param name="Role" value="{!$User.UserRoleId}"/>
<apex:param name="Department" value="{!$User.Department}"/>
<apex:param name="CurrUserID" value="{!$User.Id}"/>
</flow:interview>
Apex Class:
I just do not know how to make the test class in this situation. I appreciate any help.public class Quick_Case {
Public Flow.Interview.Quick_Case flowInstance{get; set;}
Public PageReference getFinishLocation(){
String ID = '';
if(flowInstance != null)
ID = flowInstance.caseid;
PageReference send = new PageReference('/' + ID);
send.setRedirect(true);
return send;
}}
답변 1개

The kicker is that Flow requires user intervention, so it becomes a challenge to run via Unit Test. You may want to refactor your code a bit so you can set the "Id" variable via your Unit Test, as well as instanciate "flowInstance" to bypass line 8.