Skip to content

Commit

Permalink
Remove sorting and filtering by the MailingState__c field allow it to…
Browse files Browse the repository at this point in the history
… support encrption
  • Loading branch information
force2b committed Jan 10, 2024
1 parent d51b683 commit 5b8f1ad
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions force-app/test/ADDR_Addresses_TEST.cls
Original file line number Diff line number Diff line change
Expand Up @@ -809,9 +809,12 @@ public with sharing class ADDR_Addresses_TEST {
);
insert contact;

Address__c overrideAddress = [SELECT Undeliverable__c
FROM Address__c
WHERE MailingState__c = 'Pennsylvania'];
UTIL_Finder queryByState = new UTIL_Finder(Address__c.SObjectType)
.withSelectFields(new List<String>{ 'Undeliverable__c' })
.withWhere(new UTIL_Where.FieldExpression(Address__c.MailingState__c).equals('Pennsylvania'));


Address__c overrideAddress = (Address__c)(queryByState.find()[0]);

Test.startTest();
overrideAddress.Undeliverable__c = true;
Expand Down Expand Up @@ -2229,10 +2232,12 @@ public with sharing class ADDR_Addresses_TEST {
insert testContact;
Test.stopTest();

Address__c testAddress = [SELECT Latest_Start_Date__c, Default_Address__c
FROM Address__c
WHERE MailingState__c = 'Washington'
LIMIT 1];
UTIL_Finder queryByState = new UTIL_Finder(Address__c.SObjectType)
.withSelectFields(new List<String>{ 'Latest_Start_Date__c', 'Default_Address__c' })
.withWhere(new UTIL_Where.FieldExpression(Address__c.MailingState__c).equals('Washington'))
.withLimit(1);

Address__c testAddress = (Address__c)(queryByState.find()[0]);
System.assertEquals(true, testAddress.Default_Address__c, 'Address should be set as the default address.');
System.assertEquals(System.today(), testAddress.Latest_Start_Date__c, 'The default address latest start date ' +
'should be set to today\'s date.');
Expand Down Expand Up @@ -2548,7 +2553,6 @@ public with sharing class ADDR_Addresses_TEST {
MailingStreet__c, MailingCity__c, MailingState__c,
MailingPostalCode__c, MailingCountry__c
FROM Address__c
ORDER BY MailingState__c
];
}

Expand Down

0 comments on commit 5b8f1ad

Please sign in to comment.