-
Constructor not defind in the test class error for Salesforce Batch Class.
I wrote one batch class with contractor like below. but when i was try to run my test class i am getting an error that constructor is not defind. below is my test class as well , can anyone help me plesae . thanks in advance
private list<String> sOrganization; public UpdateAccountCallList(String[] sorg) { sOrganization = sorg; }
Test class:
/* * @author Aditya * @date 10.12.2018 * @description This class will cover the code of below batch class * @revision(s) * @class Batch class :UpdateAccountCallList. */ @isTest public class AccountUpdatecallistBatchJobTest { static testMethod void testMethod1() { List<Account> lstAccount= new List<Account>(); List<Account> lstAccount1= new List<Account>(); List<Account> lstAccount2= new List<Account>(); List<Account> lstAccount3= new List<Account>(); List<Account> lstAccount4= new List<Account>(); List<Account> lstAccount5= new List<Account>(); for(Integer i=0 ;i <5;i++) { Account acc = new Account(); acc.Name =’Name’+i; acc.Call_List_Frequency__c=8; acc.Call_List__c=true; acc.Call_List_Start_Date__c=system.today()-1; acc.Call_List_Preferred_Day__c=’MOnday’; date myDate = date.today(); acc.Call_List_Next_Preferred_Date__c=myDate.toStartofWeek()+0; Account acc1 = new Account(); acc1.Name =’Name1’+i; acc1.Call_List_Frequency__c=6.0; acc1.Call_List__c=true; acc1.Call_List_Start_Date__c=system.today()-1; acc1.Call_List_Preferred_Day__c=’Tuesday’; date myDate1 = date.today(); acc1.Call_List_Next_Preferred_Date__c=myDate1.toStartofWeek()+1; lstAccount1.add(acc1); Account acc2 = new Account(); acc2.Name =’Name1’+i; acc2.Call_List_Frequency__c=6.0; acc2.Call_List__c=true; acc2.Call_List_Start_Date__c=system.today()+1; acc2.Call_List_Preferred_Day__c=’Wednesday’; date myDate2 = date.today(); acc2.Call_List_Next_Preferred_Date__c=myDate2.toStartofWeek()+2; lstAccount2.add(acc2); Account acc3 = new Account(); acc3.Name =’Name1’+i; acc3.Call_List_Frequency__c=6.0; acc3.Call_List__c=true; acc3.Call_List_Start_Date__c=system.today()-1; acc3.Call_List_Preferred_Day__c=’Thursday’; date myDate3 = date.today(); acc3.Call_List_Next_Preferred_Date__c=myDate3.toStartofWeek()+3; lstAccount3.add(acc3); Account acc4 = new Account(); acc4.Name =’Name1’+i; acc4.Call_List_Frequency__c=6.0; acc4.Call_List__c=true; acc4.Call_List_Start_Date__c=system.today()-1; acc4.Call_List_Preferred_Day__c=’Friday’; date myDate4 = date.today(); acc4.Call_List_Next_Preferred_Date__c=myDate4.toStartofWeek()+4; lstAccount4.add(acc4); Account acc5 = new Account(); acc5.Name =’Name1’+i; acc5.Call_List_Frequency__c=6.0; acc5.Call_List__c=true; acc5.Call_List_Start_Date__c=system.today()-1; acc5.Call_List_Preferred_Day__c=’None’; acc5.Call_List_Next_Preferred_Date__c=system.today(); lstAccount5.add(acc5); } insert lstAccount; insert lstAccount1; insert lstAccount2; insert lstAccount3; insert lstAccount4; insert lstAccount5; Test.startTest(); UpdateAccountCallList obj = new UpdateAccountCallList(); obj.currentweek=9; DataBase.executeBatch(obj); Test.stopTest(); } }
Log In to reply.
Popular Salesforce Blogs
Salesforce Marketing Cloud Benefits in 2024
Contents Why choose the Salesforce Marketing Cloud? Key Benefits of Salesforce Marketing Cloud Personalization Multi-Channel Marketing Marketing Automation Data-Driven Insights Audience Segmentation Lead Management Scalability…
Salesforce Governor Limits
Before starting to know all the rules(which we are always so excited to follow.Not!). We need to know why we need all these rules(which Salesforce…
How to Integrate Salesforce with Outlook?
You can follow the following steps to integrate Salesforce with Outlook: Firstly, log in to your salesforce org. Click on Setup. In the Quick Find…
Popular Salesforce Videos
Data Archiving in Salesforce | Backup and Restore
Learn the techniques, patterns and strategies when it comes to handling data archiving, backup and restores. Watch this video and learn all about it, do…
Why Should You Attend Dreamforce To You 2020
Dreamforce - The event which brings together the entire Salesforce community is just around the corner. Learn why there’s so much hype around this mega…
How Easy (or Difficult) is it to Transition from Salesforce Classic to Lightning Experience?
This video answers the question of: How Do You Transition Your Company from Salesforce Classic to Lightning Experience? ▪️ How difficult is it? ▪️ How long should…
Popular Salesforce Infographics
6 Signs Your Business Needs a Salesforce CRM
When people talk about Customer Relationship Management (CRM), they are usually referring to a system that helps with contact management, sales management, productivity, and more.…
Welcome to the Internet of Customers | Salesforce Infographic
You’ve heard this age-old adage a thousand times: “The customer is always right.” Today more than ever, the customer has countless technologies and practices in…
Maximize Your Business ROI with Salesforce CRM – The Do’s and Don’ts
Salesforce is The Largest CRM Provider in The World with 19.5% of the market share. Companies that use Salesforce CRM, have experienced: 41% increase in…