Just started with Apex last week so very new. Building a @RestResource to pick up webhooks sent from an external DB. Code has been tested and working as expected in Sandbox. Can not get the unit test to run to move to production.
Error - classes/RobinRestResourceTest.cls: Method does not exist or incorrect signature: void doPost(String, String, String, String, String, String, String, String) from the type RobinRestResourceOrg
@RestResource(urlMapping='/Prod/Org/*') global without sharing class RobinRestResourceOrg { @HttpPost //Pass in webhook payload global static String doPost(Integer id, String org_name, String org_id, String owner_email, String owner_domain, Integer owner_id, Integer is_trial, String org_slug) { //Look for any matching SFDC records to continue (custom ID then account domain) List<Robin_Organization__c> orgs = [SELECT Id FROM Robin_Organization__c WHERE Name =: org_id]; if(orgs.isEmpty()) { List<Account> accounts = [SELECT Id FROM Account WHERE Company_Domain__c =: owner_domain]; if(accounts.isEmpty()) { return 'No matching SFDC Account Record';} } //Update or create records ...... Test class
@isTest private class RobinRestResourceTest{ static testMethod void webhookTest(){ //Test objects Account Testacct = new Account(); Testacct.name = 'Dylan'; insert Testacct; RestRequest request = new RestRequest(); request.requestUri ='/services/apexrest/Prod/Org'; request.httpMethod = 'POST'; RestContext.request = request; Test.startTest(); RobinRestResourceOrg.doPost('1','Dylan Inc','43','[email protected]','dylan.com','1','0','DylanWil'); Test.stopTest(); Error - Result: [OPERATION FAILED]: classes/RobinRestResourceTest.cls: Method does not exist or incorrect signature: void doPost(String, String, String, String, String, String, String, String) from the type RobinRestResourceOrg (Line: 16, Column: 26)
Already looked around by error seems generic and could not pin point a solution.