You need to sign in to do that
Don't have an account?
ram sb
Test Class Help for RestAPI
Could you please help me write test class for this?
@RestResource(urlMapping='/RESTService/*') global with sharing class APPRestService { @HttpGet global static MergeWrap getempRecord() { MergeWrap Wrapper = new MergeWrap(); Wrapper.EmployerList = [SELECT Name,Organization_Name__c,Organization_Logo__c,Organization_Street_Address__c, Organization_Apt__c,Organization_City__c,Organization_County__c,Organization_Phone__c, Organization_Phone_Ext__c,Organization_State__c FROM Organization__c]; Wrapper.ApplicationList = [SELECT InstitutionName__c,Mailing_Address_Street_1__c,Mailing_Address_Street_2__c, Mailing_Address_City__c,Mailing_Address_State__c,Mailing_Address_Zip__c, From Application__c]; return Wrapper; } global class MergeWrap{ global List<Application__c> ApplicationList; global List<Organization__c> EmployerList; } }
Try the below code:
http://www.infallibletechie.com/2018/07/sample-inbound-rest-api-test-class-in.html
http://himanshurana.in/apex-rest-resource-test-class/
Thanks,
Maharajan.C
All Answers
Try the below code:
http://www.infallibletechie.com/2018/07/sample-inbound-rest-api-test-class-in.html
http://himanshurana.in/apex-rest-resource-test-class/
Thanks,
Maharajan.C
following erros, Could you please suggest?
Line 23: Invalid type: MergeWrap
Line 30: illegal assignment from APPRestService.MergeWrap
Change the line no: 23 as below in test class:
APPRestService.MergeWrap Wrapper = new APPRestService.MergeWrap();
Thanks,
Maharajan.C