This is easily achieved with bind variables. Sanitising the user input protects against SOQL injection by ensuring values are treated as values and not accidently interpreted as extensions to a query. FlowTestCoverage | Tooling API | Salesforce DevelopersĪny area where user input is used to query data within the database should be considered an avenue for attack and should be protected against. While test coverage is generated for flows, it is not a requirement to get 75% test coverage for a flow to be deployed to production, unlike Apex. Lastly invokable flows are invoked via something external to the flow, this could be another flow, a process builder, Apex or via the API. Scheduled flows are time-based flows, invoked at a specific time or interval. Like the name suggests, record triggered flows are triggered from record actions, such as save or update, and can operate in both a before and after save context. Headless flows have many invocation mechanisms, which can be further categorised into record triggered, scheduled, and externally triggered. The other type are headless flows, these run without any user interface, just like Apex triggers. Screen based flows which combine automated processes with screens presented to a user. It also creates a snapshot of the created data which is rolled back to, so after each test method has been run each test gets a fresh set of data, much quicker than having to set it up itself.įlows can be invoked from numerous different sources these can be split into two categories. This method is called before any tests are run and allows the test records to be created before the tests themselves are run. The annotated method within a test class is designed entirely for the setting up of data within the test. This greatly increases the ease of setting up records for our tests. Two strategies to help reduce the effort required is to utilise a test data factory and to utilise a annotated method within our test class.Ī test data factory is a class that we set up, which contains several different methods designed specifically to create generic records and their dependencies exclusively for use within test classes. When we write our unit tests, one of the most important and time-consuming steps is setting up test data.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |