You need to sign in to do that
Don't have an account?
Deepak Sharma 184
Test Class for Html file in static resource
Hi,
I have stored the html page in static resource and showing it via lightning component. how to cover the static resource test class?
Apex code -
@auraEnabled
public static string getFooterContent(String staticResourceName) {
Blob bodydata = [SELECT Body FROM StaticResource WHERE Name = :staticResourceName].Body;
String s = bodydata.toString();
return s;
}
I have stored the html page in static resource and showing it via lightning component. how to cover the static resource test class?
Apex code -
@auraEnabled
public static string getFooterContent(String staticResourceName) {
Blob bodydata = [SELECT Body FROM StaticResource WHERE Name = :staticResourceName].Body;
String s = bodydata.toString();
return s;
}
Hii Deepak
Please Mark It As Best Answer If It HelpsWe Cannot Create Static Resource In Apex
So We Have Just Call The Methos From Test Class And pass The Static Resource Name Availiable in Your Org
Thank You!
All Answers
Try Below Test Class Please Mark It As Best Answer If It Helps
Thank You!
Thanks for your reply.
I think we need to insert the static resource html file, before calling the method.
its giving the List has no rows for assignment to SObject.
Regards,
Deepak
Hii Deepak
Please Mark It As Best Answer If It HelpsWe Cannot Create Static Resource In Apex
So We Have Just Call The Methos From Test Class And pass The Static Resource Name Availiable in Your Org
Thank You!
Thanks for your help! Charu