-
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
Using a Salesforce Data Import Wizard - All you Need to Know
Salesforce is an integrated technology platform that enables companies to automate business processes. It is used as a software application that delivers Structured Query Language…
Building an Azure DevOps Pipeline for Salesforce Scratch Org Automation: A Journey to Success
It's exciting to solve a challenging problem. I recently went through such a journey when tasked with automating Salesforce Scratch Org Automation workflows through Azure…
How Salesforce Consulting Services Transform Enterprise Digital Strategies
Enterprise digital strategies have shifted from simple technology upgrades to complete business transformation. Today, customer expectations, sales processes, and data-driven decision-making all require systems that…
Popular Salesforce Videos
Salesforce Development Master Training | Salesforce Development Course
Shrey Finally launched the most awaited Salesforce Development Master Training. Features of the course are: Learn Salesforce Development from Scratch with more than 100 on-demand…
7 Tips To Choose The Right CRM For Your Business
A Customer Relationship Management (CRM) system can be overwhelming to choose from. You have so many options to choose from, each offering different tools and…
Prepopulate Field values in Salesforce Lightning Experience Using defaultFieldValues
Prepopulate Field values in Lightning Experience Using defaultFieldValues - Spring 20 This video demonstrates the following items: Set Record Type Id Using defaultFieldValues Enforce User…
Popular Salesforce Infographics
How to Select A Cerified Salesforce Administrator?
Once you implement Salesforce, one of the most important ways to stay successful is to designate an incredible Salesforce Administrator. Easier said than done, right?…
Salesforce and QuickBooks Integration With Fexle Services
How To Leverage Quickbooks and Salesforce Integration for Businesses? The pairing of the two most powerful platforms – Salesforce and Quickbooks – always garner the…
Salesforce – The Future of Digital Transformation | An Infographic
Salesforce has been coined as the world’s top CRM company and customer company. It has been soaring high in the clouds, so let’s brush through…