Test Class for Apex REST Callout

A Developer wants to implement a connection from Salesforce to a 3rd party API using Apex; A great method for retrieving external data is to implement a HTTP callout process using Apex. How can we run test class for callout ? As you may know, Apex Test Classes will not let us conduct a HTTP callout; therefore, it…

How to create and use Apex Rest Services in Salesforce ?

The Force.com REST API lets you integrate external system with Force.com applications using simple HTTP methods, in either XML or JSON formats, making this an ideal API for developing mobile applications or third party applications. Following are the benefits of using the REST API in your integrations: Easy Access: Use standard HTTP method call-outs, available on…

How to write test class for Apex Rest Services ?

A Developer wants to push the rest service to production which requires a code coverage as per the deployment strategy and best practices of salesforce. In this scenario, we must create a test class to test the rest services Rest Service Class:- @RestResource(urlMapping=’/Account/*’) global with sharing class AccountService { @HttpGet global static Account doGet() {…