From 879ccdba1b6330ebc69e694e33e84e7e22aa5ccb Mon Sep 17 00:00:00 2001 From: Reede Stockton Date: Thu, 16 Nov 2023 14:14:08 -0800 Subject: [PATCH] Fix encryption error in Potential Duplicates test --- .../main/default/classes/PotentialDuplicates_TEST.cls | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/force-app/main/default/classes/PotentialDuplicates_TEST.cls b/force-app/main/default/classes/PotentialDuplicates_TEST.cls index e50ee5fe546..b6e193b041e 100644 --- a/force-app/main/default/classes/PotentialDuplicates_TEST.cls +++ b/force-app/main/default/classes/PotentialDuplicates_TEST.cls @@ -21,8 +21,15 @@ private with sharing class PotentialDuplicates_TEST { Map 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'); } } } \ No newline at end of file