File tree Expand file tree Collapse file tree 5 files changed +32
-5
lines changed
trigger-actions-framework/main/default/classes Expand file tree Collapse file tree 5 files changed +32
-5
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ global class FormulaFilter {
103103 );
104104 toProcess .newSobject = record ;
105105 toProcess .oldSobject = recordPrior ;
106- if ((Boolean ) fx .evaluate (toProcess )) {
106+ if ((Boolean ) fx .evaluate (toProcess ) == true ) {
107107 result .triggerNew .add (record );
108108 result .triggerOld .add (recordPrior );
109109 }
Original file line number Diff line number Diff line change 1616@SuppressWarnings(
1717 ' PMD.ApexUnitTestClassShouldHaveRunAs, PMD.AvoidGlobalModifier'
1818)
19- @IsTest
19+ @IsTest( IsParallel = true )
2020global class FormulaFilterTest {
2121 private static final String ACCOUNT_SOBJECT_NAME = ' Account' ;
2222 private static final String EXCEPTION_SHOULD_BE_THROWN = ' An exception should be thrown' ;
@@ -327,6 +327,33 @@ global class FormulaFilterTest {
327327 );
328328 }
329329
330+ @IsTest
331+ private static void formulaEvaluatingToNullShouldBeTreatedAsFalse () {
332+ triggerNew [1 ].Description = ' example 1' ;
333+ configuration .Entry_Criteria__c = ' CONTAINS(record.Description, "example")' ;
334+ FormulaFilter filter = new FormulaFilter (
335+ configuration ,
336+ TriggerOperation .BEFORE_UPDATE ,
337+ ACCOUNT_SOBJECT_NAME
338+ );
339+
340+ FormulaFilter .Result result = filter .filterByEntryCriteria (
341+ triggerNew ,
342+ triggerOld
343+ );
344+
345+ System .Assert .areEqual (
346+ 1 ,
347+ result .triggerNew .size (),
348+ ' Only 1 record should be processed when CONTAINS evaluates to null for the first record'
349+ );
350+ System .Assert .areEqual (
351+ 1 ,
352+ result .triggerOld .size (),
353+ ' Only 1 record should be processed when CONTAINS evaluates to null for the first record'
354+ );
355+ }
356+
330357 @SuppressWarnings('PMD.ApexDoc')
331358 global class AccountTriggerRecord extends TriggerRecord {
332359 global Account record {
Original file line number Diff line number Diff line change 1515 */
1616
1717@SuppressWarnings(' PMD.ApexDoc, PMD.ApexUnitTestClassShouldHaveRunAs' )
18- @IsTest
18+ @IsTest( IsParallel = true )
1919private class TriggerActionFlowAddErrorTest {
2020 private static final String MY_STRING = ' MY_STRING' ;
2121 private static final String NAME = ' Name' ;
Original file line number Diff line number Diff line change 1515 */
1616
1717@SuppressWarnings(' PMD.ApexDoc, PMD.ApexUnitTestClassShouldHaveRunAs' )
18- @IsTest
18+ @IsTest( IsParallel = true )
1919private class TriggerActionFlowClearBypassTest {
2020 private static final String MY_STRING = ' MY_STRING' ;
2121 private static List <TriggerActionFlowClearBypass .Request > requests = new List <TriggerActionFlowClearBypass .Request >();
Original file line number Diff line number Diff line change 1515 */
1616
1717@SuppressWarnings(' PMD.ApexDoc, PMD.ApexUnitTestClassShouldHaveRunAs' )
18- @IsTest
18+ @IsTest( IsParallel = true )
1919private class TriggerActionFlowIsBypassedTest {
2020 private static final String MY_STRING = ' MY_STRING' ;
2121 private static List <TriggerActionFlowIsBypassed .Request > requests = new List <TriggerActionFlowIsBypassed .Request >();
You can’t perform that action at this time.
0 commit comments