Need to Write Apex Test class for a LogicI need to write a Salesforce Apex Test class for a logic:The main class is written below. The coverage should be 90%. Code: //PACTMS_QueueAssignment_Batch global class PACTMS_QueueAssignment_Batch implements Database.Batchable { String query; global PACTMS_QueueAssignment_Batch() { } global Database.QueryLocator start(Database.BatchableContext BC) { Batch_Job_Queries__mdt bqm = [SELECT FirstHour__cCall_Attempt_Less_Than_2_And_No_Answer__cSecond_Call_Attempt_or_Manual_Monitiorin__c FROM Batch_Job_Queries__mdt LIMIT 1]; Integer currentHr = DateTime.now().hour(); System.debug(currentHr + currentHr); if(currentHr <= bqm.FirstHour__c) query = bqm.Call_Attempt_Less_Than_2_And_No_Answer__c; else query = bqm.Second_Call_Attempt_or_Manual_Monitiorin__c; /*System.debug(query + query); List ex = [SELECT IdOwner.NameOwnerId Call_Attempt_No__cPACTMS_Jurisdiction__cEnd_Reason__cPACTMS_Contact_Status__cCall_Outcome__cMonitor_Status__cQuarantineEndDate__c FROM Exposure__c WHERE OwnerId IN (SELECT Id FROM Group WHERE Name = Staging Queue)]; System.debug(HM:+ex); System.debug(HM.size:+ex.size()); for(Exposure__c exp : ex) { System.debug(HM.Owner:+exp.OwnerId); //System.debug(HM.Owner.Id:+exp.Owner.id); //System.debug(HM.Owner.Name:+exp.Owner.Name); } List ex2 = [SELECT IdOwner.Name Call_Attempt_No__cPACTMS_Jurisdiction__cEnd_Reason__cPACTMS_Contact_Status__cCall_Outcome__cMonitor_Status__cQuarantineEndDate__c FROM Exposure__c WHERE Call_Attempt_No__c < 3 AND Call_Outcome__c IN (Left Message via phone and textNo Answer and no message) AND OwnerId IN (SELECT Id FROM Group WHERE Name = Staging Queue)]; System.debug(HM2:+ex2);*/ return Database.getQueryLocator(query); } global void execute(Database.BatchableContext BCList scope) { System.debug(DEL DEBUG_SCOPE= + scope); List lstexpRecs = new List(); List groupList = [select Id Name DeveloperName from Group where Type = Queue]; Map groupMap = New Map(); for(Group grp : groupList) { groupMap.put(grp.Namegrp); } System.debug(DEL groupMap= + groupMap); //Sai Ayta 10/28/2020 Household contact logic //PACTMS_HouseholdQueueAssignmentHandler handler = new PACTMS_HouseholdQueueAssignmentHandler(); //list listExp = handler.GroupHouseHolds(scope); //End Sai Ayta 10/28/2020 for(sObject expObj : scope) { Exposure__c exp = (Exposure__c)expObj; System.debug(DEL Exposure__c exp: + exp); Id queueId; if(exp.PACTMS_Jurisdiction__c != ) { queueId = groupMap.get(exp.PACTMS_Jurisdiction__c).Id; } Id stagingQueueId = groupMap.get(Staging Queue).Id; System.debug(DEL Jurisdiction queueId: + queueId); if(exp.QuarantineEndDate__c <= Date.today() && exp.PACTMS_Contact_Status__c != Closed) { exp.OwnerId = groupMap.get(Archive Queue).Id; exp.PACTMS_Contact_Status__c = Closed; exp.End_Reason__c = Monitoring Ended; } else { System.debug(Entered the assignment queueId: + queueId); exp.OwnerId = queueId; } lstexpRecs.add(exp); } if(lstexpRecs.size() > 0) { List eventList = new List(); try { Database.SaveResult[] srList = Database.update(lstexpRecs true); for (Database.SaveResult sr : srList) { if (sr.isSuccess()) { System.debug(Successful Records are + sr.getId()); } else { for(Database.Error objErr : sr.getErrors()) { eventList.add(PACTMS_errorLog.createEventErrorLog(objErr.getmessage() sr.getId() PACTMS_QueueAssignment_Batch Exposure record not moving from Staging Queue objErr.getStatusCode() + + objErr.getFields())); } } } } catch(Exception ex) { PACTMS_errorLog.createEventErrorLog(ex.getMessage() lstexpRecs[0].id PACTMS_QueueAssignment_Batch Queue ex.getStackTraceString()); } finally{ if(eventList.isEmpty() == false){ PACTMS_errorLog.persistErrorLogEvent(eventList); } } } } global void finish(Database.BatchableContext BC) { } }

Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more

Order your essay today and save 30% with the discount code HAPPY