• Pritam Gajghate
  • NEWBIE
  • 5 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies
Hi All,

I want to run only failed test cases of Test class. Can anyone share the steps please.

Thanks.  
Hi Everyone,

Please help me on fixing this error in my test class.

@istest
    public static void processMap(){
     String s = '{"insurances":[{"insurancepolicyholdercountrycode":"USA","insuranceplanname":"ARROHEALTH","insurancetype":"Other","insurancepolicyholderlastname":"WHITE","insurancephone":"(855) 651-1890","insuredentitytypeid":1,"relationshiptoinsuredid":1,"insuranceid":"22928","casepolicytypename":"Contracts","insurancepolicyholder":"SKYLAR WHITE","relationshiptoinsured":"Self","eligibilitystatus":"Unverified","insurancepolicyholderfirstname":"SKYLAR","insurancepackageid":455702,"insurancepolicyholdersex":"F","insurancepolicyholdercountryiso3166":"US","ircname":"Corporate Billing"}],"count":7}';
      Account a = new Account(Name = 'Test'+  Date.Today());
        insert a;
        
        Map<Account,String> m_aS = new Map<account,String>();
        m_as.put(a,s);
        
        Eligibility.processresponseMap(m_as);
        
    }

Class: 
@TestVisible
    private static Map<Account, List<Insurance_eligibility__c>> processresponseMap(Map<Account, String> m_accountResponse){
        
       Map<Account, List<Insurance_eligibility__c>> m_accountsToInsurances = new Map<Account, List<Insurance_eligibility__c>>();
        
        for(Account a: m_accountResponse.keyset()){
           if(m_accountResponse.get(a) != null){
               string response =  m_accountResponse.get(a);
               EligibilityWrapper ew = new EligibilityWrapper().parse(response);
               //Parse the wrapper/response for this account and generate the eligibility records
               if(ew != null){
                   List<Insurance_eligibility__c>  l_tempIe = Eligibility.createEligibilityRecords(a, ew);
                   Account aUpdated = updateEligibilityOnAccount(a, l_tempIe);
                   m_accountsToInsurances.put(aUpdated,l_tempIe);
               }
            }
        }
        return m_accountsToInsurances;
    }

Appreciate your quick response.
Thank you!
Hi All,

I want to run only failed test cases of Test class. Can anyone share the steps please.

Thanks.  
Hi Everyone,

Please help me on fixing this error in my test class.

@istest
    public static void processMap(){
     String s = '{"insurances":[{"insurancepolicyholdercountrycode":"USA","insuranceplanname":"ARROHEALTH","insurancetype":"Other","insurancepolicyholderlastname":"WHITE","insurancephone":"(855) 651-1890","insuredentitytypeid":1,"relationshiptoinsuredid":1,"insuranceid":"22928","casepolicytypename":"Contracts","insurancepolicyholder":"SKYLAR WHITE","relationshiptoinsured":"Self","eligibilitystatus":"Unverified","insurancepolicyholderfirstname":"SKYLAR","insurancepackageid":455702,"insurancepolicyholdersex":"F","insurancepolicyholdercountryiso3166":"US","ircname":"Corporate Billing"}],"count":7}';
      Account a = new Account(Name = 'Test'+  Date.Today());
        insert a;
        
        Map<Account,String> m_aS = new Map<account,String>();
        m_as.put(a,s);
        
        Eligibility.processresponseMap(m_as);
        
    }

Class: 
@TestVisible
    private static Map<Account, List<Insurance_eligibility__c>> processresponseMap(Map<Account, String> m_accountResponse){
        
       Map<Account, List<Insurance_eligibility__c>> m_accountsToInsurances = new Map<Account, List<Insurance_eligibility__c>>();
        
        for(Account a: m_accountResponse.keyset()){
           if(m_accountResponse.get(a) != null){
               string response =  m_accountResponse.get(a);
               EligibilityWrapper ew = new EligibilityWrapper().parse(response);
               //Parse the wrapper/response for this account and generate the eligibility records
               if(ew != null){
                   List<Insurance_eligibility__c>  l_tempIe = Eligibility.createEligibilityRecords(a, ew);
                   Account aUpdated = updateEligibilityOnAccount(a, l_tempIe);
                   m_accountsToInsurances.put(aUpdated,l_tempIe);
               }
            }
        }
        return m_accountsToInsurances;
    }

Appreciate your quick response.
Thank you!