Skip to content

Commit a2f7b82

Browse files
committed
Fix SOQLEvaluator_Test
1 parent 0d17a03 commit a2f7b82

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

force-app/main/default/classes/main/soql-evaluator/SOQLEvaluator_Test.cls

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,15 @@ private class SOQLEvaluator_Test {
130130
static void sObjectsToIdsOfRelationshipFieldWithMocking() {
131131
// Setup
132132
SOQLEvaluator.mock('mockingQuery').thenReturn(new List<Account>{
133-
new Account(Name = 'Test 1', Parent = new Account(CreatedById = UserInfo.getUserId())),
134-
new Account(Name = 'Test 2', Parent = new Account(CreatedById = UserInfo.getUserId()))
133+
new Account(Name = 'Test 1', Parent = new Account(ParentId = SOQL.IdGenerator.get(Account.SObjectType))),
134+
new Account(Name = 'Test 2', Parent = new Account(ParentId = SOQL.IdGenerator.get(Account.SObjectType)))
135135
});
136136

137137
// Test
138-
Set<Id> createdByIds = SOQLEvaluator.of([SELECT Id, Parent.CreatedById FROM Account WHERE ParentId != null]).mockId('mockingQuery').toIdsOf('Parent', Account.CreatedById);
139-
138+
Set<Id> parentIds = SOQLEvaluator.of([SELECT Id, Parent.ParentId FROM Account WHERE ParentId != null]).mockId('mockingQuery').toIdsOf('Parent', Account.ParentId);
139+
140140
// Verify
141-
Assert.areEqual(1, createdByIds.size(), 'The size of the returned set should be 1, because the same user inserted the accounts.');
141+
Assert.areEqual(2, parentIds.size(), 'The size of the returned set should be 2, because the accounts have a parent.');
142142
}
143143

144144
@IsTest

0 commit comments

Comments
 (0)