You need to sign in to do that
Don't have an account?
aaryansri
Mock Response for Testing Web Service Callouts
Hi
I need Mock Response for Testing Web Service Callouts and test class for below webservice code can some body help on that the class code covrage is showing 0%.
//Class used to get component record ID to be used in custom buttons without hardcode.//
Global without sharing class GetComponentId{
WebService static string GetIDbyComponentName(String ComponentName, String ComponentType) {
if(ComponentType == 'Report'){
String ComponentId = [SELECT Id FROM Report WHERE DeveloperName = :ComponentName LIMIT 1].Id;
return ComponentId;
}else
{ String ComponentId = 'error';
return ComponentId;
}
}
}
I need Mock Response for Testing Web Service Callouts and test class for below webservice code can some body help on that the class code covrage is showing 0%.
//Class used to get component record ID to be used in custom buttons without hardcode.//
Global without sharing class GetComponentId{
WebService static string GetIDbyComponentName(String ComponentName, String ComponentType) {
if(ComponentType == 'Report'){
String ComponentId = [SELECT Id FROM Report WHERE DeveloperName = :ComponentName LIMIT 1].Id;
return ComponentId;
}else
{ String ComponentId = 'error';
return ComponentId;
}
}
}
http://learningthecloudway.blogspot.co.uk/2013/10/how-to-create-mock-http-response-in.html