You need to sign in to do that
Don't have an account?
Geetu
TestClass for retrieval of custom settings values
Hi, I have a custom setting "XYZ" and Name . I want to write a test class for retriving value of URLLink for custom settin "XYZ" .
I have written my test class, and have properly inserted values for custom setting and URLLink but still i am getting "
@AuraEnabled
public static string GetCustomsettingValueName()
{
Object_Name Obj= Object_Name.getValues('XYZ settin');
return Obj.URLLink;
}
Testclass :
Custom_obj CDH = new Custom_obj();
Custom_ob.Name = 'Test Custom settinges';
CDH.URLLink='http://www.Test';
insert CDH;
I have written my test class, and have properly inserted values for custom setting and URLLink but still i am getting "
System.NullPointerException: Attempt to de-reference a null object.
can somebody pls help
can somebody pls help
@AuraEnabled
public static string GetCustomsettingValueName()
{
Object_Name Obj= Object_Name.getValues('XYZ settin');
return Obj.URLLink;
}
Testclass :
Custom_obj CDH = new Custom_obj();
Custom_ob.Name = 'Test Custom settinges';
CDH.URLLink='http://www.Test';
insert CDH;
@AuraEnabled
public static string GetIsGovernmentYesUrlRedirection()
{
CDHConfiguration__c cdhConfiguration = CDHConfiguration__c.getValues('CDH Configuration Setting');
return cdhConfiguration.IsGovernmentYesLink__c;
}