Skip to content

Commit 1e2554a

Browse files
committed
release v6.0.1
Signed-off-by: Piotr PG Gajek <[email protected]>
1 parent 2753a9d commit 1e2554a

File tree

6 files changed

+49
-49
lines changed

6 files changed

+49
-49
lines changed

force-app/main/default/classes/main/cached-soql/SOQLCache.cls

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
* Copyright (c) 2025 Beyond The Cloud Sp. z o.o. (BeyondTheCloud.Dev)
33
* Licensed under the MIT License (https://github.com/beyond-the-cloud-dev/soql-lib/blob/main/LICENSE)
44
*
5-
* v6.0.0
6-
*
5+
* v6.0.1
6+
*
77
* PMD False Positives:
88
* - ExcessivePublicCount: It is a library class and exposes all necessary methods to construct a query
99
* - ExcessiveClassLength: It is a library and we tried to put everything into ONE class
@@ -88,7 +88,7 @@ public virtual inherited sharing class SOQLCache implements Cacheable {
8888

8989
@TestVisible
9090
private static Mockable mock(String mockId) {
91-
if (!SOQLCache.queryIdToMock.containsKey(mockId)) {
91+
if (!SOQLCache.queryIdToMock.containsKey(mockId)) {
9292
SOQLCache.queryIdToMock.put(mockId, new List<SoqlMock>());
9393
}
9494
SOQLCache.queryIdToMock.get(mockId).add(new SoqlMock());
@@ -382,7 +382,7 @@ public virtual inherited sharing class SOQLCache implements Cacheable {
382382

383383
public void removeRecordsFromCache(List<SObject> recordsToRemove) {
384384
Set<Id> recordsToRemoveIds = new Map<Id, SObject>(recordsToRemove).keySet();
385-
385+
386386
List<CacheItem> filteredCachedItems = new List<CacheItem>();
387387

388388
for (CacheItem cachedRecord : getCachedRecords()) {
@@ -603,7 +603,7 @@ public virtual inherited sharing class SOQLCache implements Cacheable {
603603

604604
public Boolean haveAllRequestedFields(List<CacheItem> cachedItems) {
605605
for (CacheItem cachedItem : cachedItems) {
606-
if (!this.hasAllRequestedPlainFields(cachedItem.record) ||
606+
if (!this.hasAllRequestedPlainFields(cachedItem.record) ||
607607
!this.hasAllRequestedRelationshipFields(cachedItem.record)) {
608608
return false;
609609
}
@@ -617,7 +617,7 @@ public virtual inherited sharing class SOQLCache implements Cacheable {
617617
return false;
618618
}
619619
}
620-
620+
621621
return true;
622622
}
623623

@@ -757,4 +757,4 @@ public virtual inherited sharing class SOQLCache implements Cacheable {
757757
}
758758

759759
public class SoqlCacheException extends Exception {}
760-
}
760+
}

force-app/main/default/classes/main/cached-soql/SOQLCache_Test.cls

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
* Copyright (c) 2025 Beyond The Cloud Sp. z o.o. (BeyondTheCloud.Dev)
33
* Licensed under the MIT License (https://github.com/beyond-the-cloud-dev/soql-lib/blob/main/LICENSE)
44
*
5-
* v6.0.0
6-
*
5+
* v6.0.1
6+
*
77
* PMD False Positives:
88
* - CyclomaticComplexity: It is a library and we tried to put everything into ONE test class
99
* - CognitiveComplexity: It is a library and we tried to put everything into ONE class
@@ -314,7 +314,7 @@ private class SOQLCache_Test {
314314
static void allowFilteringByNonUniqueFields() {
315315
// Setup
316316
insert new Account(Name = 'Test Account');
317-
317+
318318
// Setup
319319
Account account = (Account) SOQLCache.of(Account.SObjectType)
320320
.with(Account.Id, Account.Name)

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
* Copyright (c) 2025 Beyond The Cloud Sp. z o.o. (BeyondTheCloud.Dev)
33
* Licensed under the MIT License (https://github.com/beyond-the-cloud-dev/soql-lib/blob/main/LICENSE)
44
*
5-
* v6.0.0
6-
*
5+
* v6.0.1
6+
*
77
* PMD False Positives:
88
* - CognitiveComplexity: It is a library and we tried to put everything into ONE class
99
**/
1010
@SuppressWarnings('PMD.CognitiveComplexity')
11-
public inherited sharing class SOQLEvaluator {
11+
public inherited sharing class SOQLEvaluator {
1212
public static SObjectEvaluable of(List<SObject> staticQueryRecords) {
1313
return new SObjectEvaluator(staticQueryRecords);
1414
}
@@ -46,7 +46,7 @@ public inherited sharing class SOQLEvaluator {
4646

4747
@TestVisible
4848
private static Mockable mock(String mockId) {
49-
if (!SOQLEvaluator.queryIdToMock.containsKey(mockId)) {
49+
if (!SOQLEvaluator.queryIdToMock.containsKey(mockId)) {
5050
SOQLEvaluator.queryIdToMock.put(mockId, new List<SoqlMock>());
5151
}
5252
SOQLEvaluator.queryIdToMock.get(mockId).add(new SoqlMock());
@@ -144,7 +144,7 @@ public inherited sharing class SOQLEvaluator {
144144
}
145145

146146
public Map<Id, SObject> toMap() {
147-
return this.converter.transform(this.toList()).toMap();
147+
return this.converter.transform(this.toList()).toMap();
148148
}
149149

150150
public Map<String, SObject> toMap(SObjectField keyField) {
@@ -214,4 +214,4 @@ public inherited sharing class SOQLEvaluator {
214214
}
215215
}
216216
}
217-
}
217+
}

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

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
22
* Copyright (c) 2025 Beyond The Cloud Sp. z o.o. (BeyondTheCloud.Dev)
33
* Licensed under the MIT License (https://github.com/beyond-the-cloud-dev/soql-lib/blob/main/LICENSE)
4-
*
5-
* v6.0.0
6-
*
4+
*
5+
* v6.0.1
6+
*
77
**/
88
@IsTest
99
private class SOQLEvaluator_Test {
@@ -118,7 +118,7 @@ private class SOQLEvaluator_Test {
118118
static void sObjectsToIdsOfRelationshipField() {
119119
// Setup
120120
insertAccountsWithParents();
121-
121+
122122
// Test
123123
Set<Id> createdByIds = SOQLEvaluator.of([SELECT Id, Parent.CreatedById FROM Account WHERE ParentId != null]).toIdsOf('Parent', Account.CreatedById);
124124

@@ -133,10 +133,10 @@ private class SOQLEvaluator_Test {
133133
new Account(Name = 'Test 1', Parent = new Account(ParentId = SOQL.IdGenerator.get(Account.SObjectType))),
134134
new Account(Name = 'Test 2', Parent = new Account(ParentId = SOQL.IdGenerator.get(Account.SObjectType)))
135135
});
136-
136+
137137
// Test
138138
Set<Id> parentIds = SOQLEvaluator.of([SELECT Id, Parent.ParentId FROM Account WHERE ParentId != null]).mockId('mockingQuery').toIdsOf('Parent', Account.ParentId);
139-
139+
140140
// Verify
141141
Assert.areEqual(2, parentIds.size(), 'The size of the returned set should be 2, because the accounts have a parent.');
142142
}
@@ -157,7 +157,7 @@ private class SOQLEvaluator_Test {
157157
static void sObjectDoExistWithMocking() {
158158
// Setup
159159
SOQLEvaluator.mock('mockingQuery').thenReturn(new Account(Name = 'Test Account'));
160-
160+
161161
// Test
162162
Boolean doesExist = SOQLEvaluator.of([SELECT Id, Name FROM Account]).mockId('mockingQuery').doExist();
163163

@@ -181,7 +181,7 @@ private class SOQLEvaluator_Test {
181181
static void sObjectToValueOfWithMocking() {
182182
// Setup
183183
SOQLEvaluator.mock('mockingQuery').thenReturn(new Account(Name = 'Test Account'));
184-
184+
185185
// Test
186186
String accountName = (String)SOQLEvaluator.of([SELECT Id, Name FROM Account]).mockId('mockingQuery').toValueOf(Account.Name);
187187

@@ -193,7 +193,7 @@ private class SOQLEvaluator_Test {
193193
static void sObjectsToValuesOf() {
194194
// Setup
195195
insertAccounts();
196-
196+
197197
// Test
198198
Set<String> accountNames = SOQLEvaluator.of([SELECT Id, Name FROM Account]).toValuesOf(Account.Name);
199199

@@ -220,7 +220,7 @@ private class SOQLEvaluator_Test {
220220
static void sObjectToObject() {
221221
// Setup
222222
insertAccount();
223-
223+
224224
// Test
225225
Account account = (Account) SOQLEvaluator.of([SELECT Id, Name FROM Account]).toObject();
226226

@@ -234,7 +234,7 @@ private class SOQLEvaluator_Test {
234234
insertAccounts();
235235
Exception queryException = null;
236236

237-
// Test
237+
// Test
238238
try {
239239
Account account = (Account) SOQLEvaluator.of([SELECT Id, Name FROM Account]).toObject();
240240
} catch (Exception e) {
@@ -249,7 +249,7 @@ private class SOQLEvaluator_Test {
249249
static void sObjectToObjectWithMocking() {
250250
// Setup
251251
SOQLEvaluator.mock('mockingQuery').thenReturn(new Account(Name = 'Test Account'));
252-
252+
253253
// Test
254254
Account account = (Account) SOQLEvaluator.of([SELECT Id, Name FROM Account]).mockId('mockingQuery').toObject();
255255

@@ -270,13 +270,13 @@ private class SOQLEvaluator_Test {
270270
static void sObjectsToList() {
271271
// Setup
272272
insertAccounts();
273-
273+
274274
// Test
275275
List<Account> accounts = SOQLEvaluator.of([SELECT Id, Name FROM Account]).toList();
276276

277277
// Verify
278278
Assert.areEqual(2, accounts.size(), 'The size of the returned list should be 2.');
279-
}
279+
}
280280

281281
@IsTest
282282
static void sObjectsToListWithMocking() {
@@ -292,12 +292,12 @@ private class SOQLEvaluator_Test {
292292
// Verify
293293
Assert.areEqual(2, accounts.size(), 'The size of the returned list should be 2.');
294294
}
295-
295+
296296
@IsTest
297297
static void sObjectsToListWhenNoRecords() {
298298
// Test
299299
List<Account> accounts = SOQLEvaluator.of([SELECT Id, Name FROM Account]).toList();
300-
300+
301301
// Verify
302302
Assert.areEqual(0, accounts.size(), 'The size of the returned list should be 0.');
303303
}
@@ -306,7 +306,7 @@ private class SOQLEvaluator_Test {
306306
static void sObjectsToMap() {
307307
// Setup
308308
insertAccounts();
309-
309+
310310
// Test
311311
Map<Id, Account> accounts = (Map<Id, Account>) SOQLEvaluator.of([SELECT Id, Name FROM Account]).toMap();
312312

@@ -321,7 +321,7 @@ private class SOQLEvaluator_Test {
321321
new Account(Name = 'Test 1'),
322322
new Account(Name = 'Test 2')
323323
});
324-
324+
325325
// Test
326326
Map<Id, Account> accounts = (Map<Id, Account>) SOQLEvaluator.of([SELECT Id, Name FROM Account]).mockId('mockingQuery').toMap();
327327

@@ -357,7 +357,7 @@ private class SOQLEvaluator_Test {
357357
new Account(Name = 'Test 1'),
358358
new Account(Name = 'Test 2')
359359
});
360-
360+
361361
// Test
362362
Map<String, Account> accounts = (Map<String, Account>) SOQLEvaluator.of([SELECT Id, Name FROM Account]).mockId('mockingQuery').toMap(Account.Name);
363363

@@ -378,7 +378,7 @@ private class SOQLEvaluator_Test {
378378
static void sObjectsToMapWithRelatedKeyField() {
379379
// Setup
380380
insertAccountsWithParents();
381-
381+
382382
// Test
383383
Map<String, Account> accounts = (Map<String, Account>) SOQLEvaluator.of([SELECT Id, Parent.Name FROM Account WHERE ParentId != null]).toMap('Parent', Account.Name);
384384

@@ -393,10 +393,10 @@ private class SOQLEvaluator_Test {
393393
new Account(Name = 'Test 1', Parent = new Account(Name = 'Parent 1')),
394394
new Account(Name = 'Test 2', Parent = new Account(Name = 'Parent 2'))
395395
});
396-
396+
397397
// Test
398398
Map<String, Account> accounts = (Map<String, Account>) SOQLEvaluator.of([SELECT Id, Parent.Name FROM Account WHERE ParentId != null]).mockId('mockingQuery').toMap('Parent', Account.Name);
399-
399+
400400
// Verify
401401
Assert.areEqual(2, accounts.size(), 'The size of the returned map should be 2.');
402402
}
@@ -429,7 +429,7 @@ private class SOQLEvaluator_Test {
429429
new Account(Name = 'Test 1', Description = 'Description 1'),
430430
new Account(Name = 'Test 2', Description = 'Description 2')
431431
});
432-
432+
433433
// Test
434434
Map<String, String> nameToDescription = SOQLEvaluator.of([SELECT Id, Name, Description FROM Account]).mockId('mockingQuery').toMap(Account.Name, Account.Description);
435435

@@ -450,7 +450,7 @@ private class SOQLEvaluator_Test {
450450
static void sObjectsToAggregatedMap() {
451451
// Setup
452452
insertAccounts();
453-
453+
454454
// Test
455455
Map<String, List<Account>> nameToAccounts = SOQLEvaluator.of([SELECT Id, Name FROM Account]).toAggregatedMap(Account.Name);
456456

@@ -465,7 +465,7 @@ private class SOQLEvaluator_Test {
465465
new Account(Name = 'Test 1', Industry = 'IT'),
466466
new Account(Name = 'Test 2', Industry = 'IT')
467467
});
468-
468+
469469
// Test
470470
Map<String, List<Account>> industryToAccounts = SOQLEvaluator.of([SELECT Id, Name, Industry FROM Account]).mockId('mockingQuery').toAggregatedMap(Account.Industry);
471471

@@ -486,7 +486,7 @@ private class SOQLEvaluator_Test {
486486
static void sObjectsToAggregatedMapWithRelatedKeyField() {
487487
// Setup
488488
insertAccountsWithParents();
489-
489+
490490
// Test
491491
Map<String, List<Account>> parentNameToAccounts = SOQLEvaluator.of([SELECT Id, Parent.Name FROM Account WHERE ParentId != null]).toAggregatedMap('Parent', Account.Name);
492492

@@ -501,7 +501,7 @@ private class SOQLEvaluator_Test {
501501
new Account(Name = 'Test 1', Parent = new Account(Name = 'Parent 1')),
502502
new Account(Name = 'Test 2', Parent = new Account(Name = 'Parent 2'))
503503
});
504-
504+
505505
// Test
506506
Map<String, List<Account>> parentNameToAccounts = SOQLEvaluator.of([SELECT Id, Parent.Name FROM Account WHERE ParentId != null]).mockId('mockingQuery').toAggregatedMap('Parent', Account.Name);
507507

@@ -522,7 +522,7 @@ private class SOQLEvaluator_Test {
522522
static void sObjectsToAggregatedMapWithKeyAndValueFields() {
523523
// Setup
524524
insertAccounts();
525-
525+
526526
// Test
527527
Map<String, List<String>> nameToDescriptions = SOQLEvaluator.of([SELECT Id, Name, Description FROM Account]).toAggregatedMap(Account.Name, Account.Description);
528528

@@ -537,7 +537,7 @@ private class SOQLEvaluator_Test {
537537
new Account(Name = 'Test 1', Description = 'Description 1'),
538538
new Account(Name = 'Test 2', Description = 'Description 2')
539539
});
540-
540+
541541
// Test
542542
Map<String, List<String>> nameToDescriptions = SOQLEvaluator.of([SELECT Id, Name, Description FROM Account]).mockId('mockingQuery').toAggregatedMap(Account.Name, Account.Description);
543543

@@ -560,7 +560,7 @@ private class SOQLEvaluator_Test {
560560
SOQLEvaluator.mock('mockingQuery').thenReturn(new Account(Name = 'Test 1'));
561561
SOQLEvaluator.mock('mockingQuery').thenReturn(new Account(Name = 'Test 2'));
562562
SOQLEvaluator.mock('mockingQuery').thenReturn(new Account(Name = 'Test 3'));
563-
563+
564564
// Test
565565
Account account1 = (Account) SOQLEvaluator.of([SELECT Id, Name FROM Account]).mockId('mockingQuery').toObject();
566566
Account account2 = (Account) SOQLEvaluator.of([SELECT Id, Name FROM Account]).mockId('mockingQuery').toObject();
@@ -624,4 +624,4 @@ private class SOQLEvaluator_Test {
624624
return [SELECT Id, Subject, Type FROM Task WITH SYSTEM_MODE];
625625
}
626626
}
627-
}
627+
}

force-app/main/default/classes/main/standard-soql/SOQL.cls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (c) 2025 Beyond The Cloud Sp. z o.o. (BeyondTheCloud.Dev)
33
* Licensed under the MIT License (https://github.com/beyond-the-cloud-dev/soql-lib/blob/main/LICENSE)
44
*
5-
* v6.0.0
5+
* v6.0.1
66
*
77
* PMD False Positives:
88
* - ExcessivePublicCount: It is a library class and exposes all necessary methods to construct a query

force-app/main/default/classes/main/standard-soql/SOQL_Test.cls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (c) 2025 Beyond The Cloud Sp. z o.o. (BeyondTheCloud.Dev)
33
* Licensed under the MIT License (https://github.com/beyond-the-cloud-dev/soql-lib/blob/main/LICENSE)
44
*
5-
* v6.0.0
5+
* v6.0.1
66
*
77
* PMD False Positives:
88
* - CyclomaticComplexity: It is a library and we tried to put everything into ONE test class

0 commit comments

Comments
 (0)