Activity Forums Salesforce® Discussions What is stoptest() in Salesforce?

  • MOHIT

    Member
    April 13, 2020 at 3:43 pm

    The Limits methods return the specific limit for the particular governor, such as the number of calls of a method or the amount of heap size remaining.
    Each method has two versions. The first version returns the amount of the resource that has been used in the current context. The second version contains the word “limit” and returns the total amount of the resource that is available for that context. For example, getCallouts returns the number of callouts to an external service that have already been processed in the current context, while getLimitCallouts returns the total number of callouts available in the given context.
    In addition to the Limits methods, use the startTest and stopTest methods to validate how close the code is to reaching governor limits.
    The stopTest method marks the point in your test code when your test ends. Use this method in conjunction with the startTest method. Each test method is allowed to call this method only once. Any code that executes after the stopTest method is assigned the original limits that were in effect before startTest was called. All asynchronous calls made after the startTest method are collected by the system. When stopTest is executed, all asynchronous processes are run synchronously.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos