Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ global class FormulaFilter {
);
toProcess.newSobject = record;
toProcess.oldSobject = recordPrior;
if ((Boolean) fx.evaluate(toProcess)) {
if ((Boolean) fx.evaluate(toProcess) == true) {
result.triggerNew.add(record);
result.triggerOld.add(recordPrior);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
@SuppressWarnings(
'PMD.ApexUnitTestClassShouldHaveRunAs, PMD.AvoidGlobalModifier'
)
@IsTest
@IsTest(IsParallel=true)
global class FormulaFilterTest {
private static final String ACCOUNT_SOBJECT_NAME = 'Account';
private static final String EXCEPTION_SHOULD_BE_THROWN = 'An exception should be thrown';
Expand Down Expand Up @@ -327,6 +327,33 @@ global class FormulaFilterTest {
);
}

@IsTest
private static void formulaEvaluatingToNullShouldBeTreatedAsFalse() {
triggerNew[1].Description = 'example 1';
configuration.Entry_Criteria__c = 'CONTAINS(record.Description, "example")';
FormulaFilter filter = new FormulaFilter(
configuration,
TriggerOperation.BEFORE_UPDATE,
ACCOUNT_SOBJECT_NAME
);

FormulaFilter.Result result = filter.filterByEntryCriteria(
triggerNew,
triggerOld
);

System.Assert.areEqual(
1,
result.triggerNew.size(),
'Only 1 record should be processed when CONTAINS evaluates to null for the first record'
);
System.Assert.areEqual(
1,
result.triggerOld.size(),
'Only 1 record should be processed when CONTAINS evaluates to null for the first record'
);
}

@SuppressWarnings('PMD.ApexDoc')
global class AccountTriggerRecord extends TriggerRecord {
global Account record {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

@SuppressWarnings('PMD.ApexDoc, PMD.ApexUnitTestClassShouldHaveRunAs')
@IsTest
@IsTest(IsParallel=true)
private class TriggerActionFlowAddErrorTest {
private static final String MY_STRING = 'MY_STRING';
private static final String NAME = 'Name';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

@SuppressWarnings('PMD.ApexDoc, PMD.ApexUnitTestClassShouldHaveRunAs')
@IsTest
@IsTest(IsParallel=true)
private class TriggerActionFlowClearBypassTest {
private static final String MY_STRING = 'MY_STRING';
private static List<TriggerActionFlowClearBypass.Request> requests = new List<TriggerActionFlowClearBypass.Request>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

@SuppressWarnings('PMD.ApexDoc, PMD.ApexUnitTestClassShouldHaveRunAs')
@IsTest
@IsTest(IsParallel=true)
private class TriggerActionFlowIsBypassedTest {
private static final String MY_STRING = 'MY_STRING';
private static List<TriggerActionFlowIsBypassed.Request> requests = new List<TriggerActionFlowIsBypassed.Request>();
Expand Down
Loading