Skip to content

Commit

Permalink
Page update
Browse files Browse the repository at this point in the history
  • Loading branch information
pkozuchowski committed Jul 18, 2024
1 parent 5af983b commit 0764245
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions docs/news/24_07_18.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,19 @@ static void testGenerateQuotes() {
});
}
```

This lets you:
- mock queries easily in tests,
- without implementing any extra classes,
- while SOQL limit is still tracked realistically
- tests are not slowed down by data creation, trigger & flow execution.
- use native inline SOQL query syntax
- use Query framework methods to strip inaccessible fields or get map of sobjects
All good things.

While a query is still issued against a database, the class received only a mocked result. This does not impact test performance much,
since a majority of the test slowdowns come from data creation and this query will be empty in tests.

Another benefit is that our pure apex tests will track query limit usage realistically.

With wrapped queries, you can also benefit from reducer methods:
![image](/img/query-wrapped.png)

Expand Down

0 comments on commit 0764245

Please sign in to comment.