After doing enough Google search and scratching my brain, I have decided to post here and seek for suggestions.
Here is the background:
- An opportunity has multiple order & order line item records
- In rare scenarios the number of Orders & OLI can go upto 20k-40k
- As part of renewal process, new opportunity is cloned from the existing opportunity. Now all the related orders & OLIs should be created (cloned) as well
Here is what we are doing:
- Calling a batch class from the trigger handler class to clone/create new orders & OLIs
- All good here so far.
Now, coming to the question. We are trying to test if this is working fine, if we are within the limits when the records are more than 10k (the DML limit). I am struggling to get answers to test this through test class. Is it possible to create more than 10k records in test classes? If yes, how?
The other option was to test this in Full Copy. But I would like to know if there is a way to do this in test classes.
Looking for suggestions and experiences.