Skip to content

Commit 8c1f9d1

Browse files
committed
fix: add test class for flow for completeness
1 parent f2a9455 commit 8c1f9d1

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* @description Test class for Instruction Action References Flows
3+
* Tests the CreateCase flow used in the instruction action references recipe
4+
*/
5+
@IsTest
6+
private class InstructionActionReferencesFlowTest {
7+
@IsTest
8+
static void testCreateCaseSuccess() {
9+
// Set input variables for the flow
10+
Map<String, Object> inputs = new Map<String, Object>();
11+
inputs.put('subject', 'Test Case Subject');
12+
13+
// Run the flow
14+
Test.startTest();
15+
Flow.Interview.CreateCase flowInterview = new Flow.Interview.CreateCase(
16+
inputs
17+
);
18+
flowInterview.start();
19+
Test.stopTest();
20+
21+
// Verify the expected outcome
22+
String caseNumber = (String) flowInterview.getVariableValue(
23+
'case_number'
24+
);
25+
26+
Assert.areNotEqual(null, caseNumber, 'Case number should be returned');
27+
Assert.areEqual(
28+
'00001234',
29+
caseNumber,
30+
'Case number should match the expected stub value'
31+
);
32+
}
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
3+
<apiVersion>65.0</apiVersion>
4+
<status>Active</status>
5+
</ApexClass>

0 commit comments

Comments
 (0)