function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Andrew Hoban 14Andrew Hoban 14 

Creating a test Class

Hi all, 
I am having truble creating a test class for this particular class. If anyone could provide some code that would implement this I would be very grateful.

Many thanks

Class:
global class TalentIntCustomerBatch implements Database.Batchable<sObject>, Database.AllowsCallouts{
  global final String query;

  global TalentIntCustomerBatch(String q){
    query=q;
  }
  
  global Database.QueryLocator start(Database.BatchableContext BC){
    return Database.getQueryLocator(query);
  }

  global void execute(Database.BatchableContext BC, List<sObject> scope){    
    for(sObject s : scope){
      Contact c = (Contact)s;
      TalentIntegrationUtils.updateCustomer(c.Id, c.LastName);
    }
  }
  
  global void finish(Database.BatchableContext BC){}
}

 
ShashankShashank (Salesforce Developers) 
You may find this useful: http://www.salesforce.com/us/developer/docs/apex_workbook/Content/apex_batch_2.htm