Monday, 9 September 2013

How to increase test coverage in salesforce for external api callout

How to increase test coverage in salesforce for external api callout

I have apex class in which i am getting lots of count from external api.
External 'api' return counts in json format. For decode this json i am
using following code,
ddDashboard obj = (ddDashboard) System.JSON.deserialize(json,
ddDashboard.class);
here 'ddDashboard' is my class name. using this i am getting counts and i
am directly assign this count to class variable.
account_total_processed_records_count=
obj.account_total_processed_records_count;
here if i write this assignment the test coverage is decreases.
Anybody can help me how can i increase test coverage for above problem OR
how can i write test method for assing count value to class variable from
external API call.
Thank you in advance, Rajendra J.

No comments:

Post a Comment