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
Krishna VegirajuKrishna Vegiraju 

I have a class in the org that has a code coverage at 0%. None of the test classes fail when i Run all tests. How do I find out the test class for this particular class.

global Class CongaImpl{

     static String version = '/services/Soap/u/39.0/';
     static String partnerUrl = Url.getSalesforceBaseUrl().toExternalForm()+version+UserInfo.getOrganizationId().subString(0,15);  
     static String congaUrl;
     
     Webservice static string leaseAgreementDocument(String recordId) {
    //  string queid='[Borrower]Label.Borrower_details,[Amortization]Label.Amortization_details,[Equipment]Label.Equipment_Details&TemplateId=Label.Hyphecation_agreement';
    //   System.debug('>>##Lease_Agreement_letter#:'+getQerystring('Lease_Agreement_letter'));
       //[Borrowersdetails]a0p5D000000D7Ce Lease_Agreement_letter
     // congaUrl=Label.Conga_URL+userinfo.getsessionId()+'&serverUrl='+partnerUrl+'&QueryId='+getQerystring('Lease_Agreement_letter')+'&DS7=1&OFN='+bName.deleteWhitespace()+'_LA&id='+recordId.subString(0,15);
        congaUrl = Label.Conga_URL+userinfo.getsessionId()+'&serverUrl='+partnerUrl+'&Id='+recordId+'&QueryId=[LA]a8G1k0000004KsR,[EQ]a8G1k0000004KsW&TemplateId=a8O1k0000008dpp&DefaultPDF=1' ;
        
        System.debug('congaUrl'+congaUrl);
        return getCalloutToConga(congaUrl);
     }
     
     public static String getCalloutToConga(String url) {
        system.debug('## URL ::'+url);
        // Instantiate a new http object
        Http h = new Http();

        // Instantiate a new HTTP request, specify the method (GET) as well as the endpoint
        HttpRequest req = new HttpRequest();
        req.setEndpoint(url);
        req.setMethod('GET');
        req.setTimeout(60000);
        // Send the request, and return a response
        try{
            HttpResponse res = h.send(req);
            if(res.getStatusCode() != 200){
                system.debug('## status <>200'+res);
                return res.getStatus();
            } else if(!Pattern.matches('[a-zA-Z0-9]{18}',res.getBody())){
                system.debug('## status ==200'+res);
                return res.getBody();
            }

        } catch(System.CalloutException em){
            System.debug('## Callout Error message: '+em.getMessage());
        } 
        return 'Document Created successfully!!';
    }

}
This is the class. I tried to check if any of the methods are being called in any of the test classes but no luck there either. Any help would be appreciated.
 
shaik murthujavalishaik murthujavali
Hi Krishna,
As shown in the below screen shot In your developer console select Open and Select your class name in open window popup, then in the right side box you can see related list.it means it shows all the components where ever this perticular class is referenced.so in this way you can find the test class.
User-added image
Hope it helps.
Let me know if it helps.

Thanks,
Shaik Murthujavali.
Krishna VegirajuKrishna Vegiraju
Hi Shaik,
Thank you very much for the reply. But there is no test class in the related either. I have attached a screen shot
.User-added image
Is there anything else I can do about this?

Thanks
Krishna
Linga_RaminLinga_Ramin
There might me no Test Class for your Controller class 'CongaImpl' I think so.
shaik murthujavalishaik murthujavali
Hi Krishna,
We have one more way.If you are using Chrome browser install "salesforce Advanced Code Searcher" . It is an extension.So by using this you search with your class name/method name then it shows all the apex classes where ever those names were reffered.
User-added image
If you still can't find the result, then there is no test class for it.(I think soo.).
Select as a best answer if you found as a best answer.

Thanks,
Shaik Murthujavali
Krishna VegirajuKrishna Vegiraju
Shaik,

I tried that and had no luck, I searched all the methods in the class with the plug in. I think there is no test class too. I just dont undertstand how someone deployed it without a test class. I guess I will just write a test class for this.

Thanks
Krishna