You need to sign in to do that
Don't have an account?
Sean M 3
Test Class for Page Redirect Visualforce Page & Apex Class
Good afternoon,
I am using an Apex Class coupled with a visualforce page to redirect a user to a Case record created from a Flow, when the Flow ends.
Code below:
I am having trouble writing a Test Class for this. Can anyone give me a starting point?
Many thanks
I am using an Apex Class coupled with a visualforce page to redirect a user to a Case record created from a Flow, when the Flow ends.
Code below:
public class flowController{ // Instanciate the Flow for use by the Controller - linked by VF interview attribute public Flow.Interview.QuickCase flowInstance {get;set;} // Set the page reference accessor methods public PageReference finishLocation { get { PageReference pageRef = new PageReference('/' + newRecordId); pageRef.setRedirect(true); return pageRef; } } // Set the accessor methods for the flow output variable public String newRecordId { get { String strTemp = ''; if(flowInstance != null) { strTemp = string.valueOf(flowInstance.getVariableValue('CreatedCaseId')); } return strTemp; } set { newRecordId = value; } } }
I am having trouble writing a Test Class for this. Can anyone give me a starting point?
Many thanks
Please try this
@isTest private class flowControllerTest {
@isTest static void testfinishLocation() {
flowController fc = new flowController();
System.assertNotEquals(null, fc.finishLocation, 'test');
}
}
All Answers
Please try this
@isTest private class flowControllerTest {
@isTest static void testfinishLocation() {
flowController fc = new flowController();
System.assertNotEquals(null, fc.finishLocation, 'test');
}
}