Skip to content

Commit

Permalink
Fix encryption error in Potential Duplicates test
Browse files Browse the repository at this point in the history
  • Loading branch information
npsp-reedestockton committed Nov 16, 2023
1 parent bd0b2e9 commit 879ccdb
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions force-app/main/default/classes/PotentialDuplicates_TEST.cls
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,15 @@ private with sharing class PotentialDuplicates_TEST {

Map<String, Object> data = PotentialDuplicates.getDuplicates(contactList[0].Id);
String setOfMatches = (String)data.get('setOfMatches');
System.assertNotEquals('', setOfMatches, 'Duplicate Ids should be returned');
Integer numberOfMatches = setOfMatches.split(',').size();
System.assertEquals(2, numberOfMatches, 'There should be 2 duplicates returned');

// Duplicates will not be found if encryption is enabled
if (sObjectType.Contact.fields.Name.isEncrypted()) {
System.assertEquals('', setOfMatches, 'No duplicate Ids should be returned if encryption is enabled');
System.assertEquals(0, numberOfMatches, 'There should be 0 duplicates returned if encryption is enabled');
}
else {
System.assertNotEquals('', setOfMatches, 'Duplicate Ids should be returned');
System.assertEquals(2, numberOfMatches, 'There should be 2 duplicates returned'); }
}
}

0 comments on commit 879ccdb

Please sign in to comment.