Note that there are some explanatory texts on larger screens.

plurals
  1. POTest Coverage for Future method salesforce
    text
    copied!<p>Hi i trying to get coverage for a class that has few future method (for web service call) and few concrete static methods. but after calling future method, i am unable to call other methods... Can you please tell me how to take coverage for future method and web service calls.</p> <p>my class structure : </p> <pre><code>public with sharing class AccountSynchController { @future (callout=true) public static void importAccount(Set&lt;Id&gt; ids) { } @future (callout=true) public static void importContact(Set&lt;Id&gt; ids) { } } [future methods are called from trigger] Test Class Code : VAT__c testVat = new VAT__c(); testVat.Code__c = '3'; insert testVat; Account testAccount = new Account(); testAccount.Name = 'Test Account'; testAccount.VATSales__c = testVat.Id; testAccount.VATPurchase__c = testVat.Id; testAccount.KvK_Nummer__c = '12312312'; testAccount.PhoneExt__c = '12312312'; testAccount.Website = '12312312'; testAccount.BillingPostalCode = '12312312'; testAccount.BillingCity = '12312312'; testAccount.Fax = '12312312'; testAccount.Phone = '12312312'; testAccount.BillingStreet = '12312312'; testAccount.BTW_Nummer__c = '12312312'; testAccount.BillingCountry = '12312312'; testAccount.BillingState = '12312312'; testAccount.BTW_Nummer__c = '12312312'; testAccount.E_mail__c = 'test@gmail.com'; testAccount.Taal__c = 'NL'; testAccount.SalesPaymentConditionCode__c = '15'; testAccount.Code__c = '102'; testAccount.fromExact__c = false; testAccount.Exact_Id__c = '123123'; insert testAccount; Contact testContact = new Contact(); testContact.AccountId = testAccount.Id; testContact.Birthdate = system.today(); testContact.Conact_Exact_Number__c = '12312312312'; testContact.Email = 'test@gmail.com'; testContact.FirstName = 'first'; testContact.Title_Code__c = 'Mr.'; testContact.Geslacht__c = 'M'; testContact.Initials__c = 'I'; testContact.Language_Code__c = 'NL'; testContact.LastName = 'last'; testContact.MiddleName__c = 'middle'; testContact.Phone = '12321312312'; testContact.fromExact__c = false; insert testContact; </code></pre> <p>Thanks..</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload