You need to sign in to do that
Don't have an account?
Michaela Chrysostomou
I have the following apex class which is redirect my flow to the record that just created
Controller
public class FlowController {
public Flow.Interview.Computer_Forms theFlow {get; set;}
public PageReference getNewDispatchRecord(){
if(theFlow == null)
return null;
else if(theflow.neorecord!=null)
return new PageReference('/' + theFlow.neorecord);
else
return new PageReference('/a28');
}
}
Test Class
@isTest
private class FlowControllerTest {
public static testMethod void myTestMethodForFlow() {
FlowController aFlowController = new FlowController();
aFlowController.theFlow= new Flow.Interview.Computer_Forms (new Map<String, Object>());
PageReference pageRef = Page.VF_for_flow_in_CF;
Test.setCurrentPage(pageRef);
string neorecord='a28550000001jch';
string OwnerId='00516000006jIub';
string Type='Desktop';
string workload='Normal';
string Reason='New';
string OS_choice='Aple';
}
}
I get code covarage 14%. Any help?
public class FlowController {
public Flow.Interview.Computer_Forms theFlow {get; set;}
public PageReference getNewDispatchRecord(){
if(theFlow == null)
return null;
else if(theflow.neorecord!=null)
return new PageReference('/' + theFlow.neorecord);
else
return new PageReference('/a28');
}
}
Test Class
@isTest
private class FlowControllerTest {
public static testMethod void myTestMethodForFlow() {
FlowController aFlowController = new FlowController();
aFlowController.theFlow= new Flow.Interview.Computer_Forms (new Map<String, Object>());
PageReference pageRef = Page.VF_for_flow_in_CF;
Test.setCurrentPage(pageRef);
string neorecord='a28550000001jch';
string OwnerId='00516000006jIub';
string Type='Desktop';
string workload='Normal';
string Reason='New';
string OS_choice='Aple';
}
}
I get code covarage 14%. Any help?
But after that I run the flow through a button that is called a Visual force page VF_for_flow_in_CF which is called the flow. Then the code covarage is increased in 71%.