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
siddartha reddy kalamsiddartha reddy kalam 

Test class for http callout

Hello everyone, I need help in writitng a test class for below code.

public with Sharing class DAP_ConcurQueueAccounts 
 public class Output{
        @InvocableVariable(required= true)
     public Integer statusCode;}
  public class Input{
        @InvocableVariable(required= false)
        public string account;
        @InvocableVariable(required= false)
        public decimal lastmod;
        @InvocableVariable(required= false)
        public string resource;
        @InvocableVariable(required= false)
        public integer maxItems;
    public static List<Output> queueAccounts(List<Input> input )
         List<Output> statuscodeoutput = new List<Output>();
        for(Input queaccinput : input)
             // JK Renamed output variable
             Output out = new Output();
             System.debug('account: ' + queaccinput.account);
             System.debug('lastmod: ' + queaccinput.lastmod);
             System.debug('resource: ' + queaccinput.resource);
             System.debug('maxItems: ' + queaccinput.maxitems);
            Long startTimeLong =;
             System.debug('Start time: ' + startTimeLong);
             String bodyString = 'account='+queaccinput.account+'&lastmod='+queaccinput.lastmod;
             System.debug('Account & lastmod params: ' + bodyString);
             HttpRequest req = new HttpRequest();
             Http http = new Http();
             HTTPResponse res = http.send(req);
             out.statusCode = res.getStatusCode();
             System.debug('Response status code: ' + res.getStatusCode());
     return  statuscodeoutput; 
Sunil SirangiSunil Sirangi

@Siddartha reddy kalam: Please let me know where you are stuck with the test class. Please post what you have written in your test class so that we can help you. If you are a beginner and want to write test class please do follow below links.

Trail Head (

Salesforce Documentation (

SFDC99 Blog (

siddartha reddy kalamsiddartha reddy kalam
@sunil sirangi. Thanks for the reply. I found my error and currently its working fine.