function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
zeenat mangatzeenat mangat 

How to create test class of the apex controller which is create by using REST api

Can we create the test class of the Lead controller that uses the REST api for Request url like this:

eg-

@RestResource(urlMapping='/v2/getCharged/*')
global with sharing class REST_ChargeNT_Controller {
       
    @HttpPost
    global static String processPayment(String orderId){
ShashankShashank (Salesforce Developers) 
Please see if this helps: http://cloudyworlds.blogspot.sg/2012/12/writing-test-classes-for-apex-rest.html