This is the test method i have writtenfor batch apex ProductUpdate .Even if i have a single callout to Database.Executebatch() I am getting the following error. Please help !
@isTest (seeAllData=true)
global class testbatchProductUpdate
{
public static testMethod void pBatchUpdate()
{
/** Product to meet the Criteria in test class **/
Product2 p = new Product2();
p.Name = 'Test Product';
p.Effective_Date__c = Date.Today();
//p.CurrencyIsoCode= 'USD';
p.Material_status__c='status';
insert p;
/** Product to meet the Criteria in test class **/
test.startTest();
batchProductUpdate bpu = new batchProductUpdate();
database.Executebatch(bpu);
test.stopTest();
}
}
Error : System.UnexpectedException: No more than one executeBatch can be called from within a testmethod. Please make sure the iterable returned from your start method matches the batch size, resulting in one executeBatch invocation.", Failure Stack Trace: "External entry point"