Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
-2 votes
1 answer
4k views

Test Class for RestResource gives "Methods defined as TestMethod do not support Web service callouts" error [duplicate]

Looking for some help here. I'm trying to write a Test Class for a RestResource I defined but am receiving the above Test Class failure. I was under the impression that you didn't need to define a ...
tontoandbandit's user avatar
0 votes
1 answer
48 views

Apex Unit Test for Rest Resource calls wrong class

I have 2 RestResource classes: @RestResource(urlMapping='/Catcher/*') global Without Sharing class vecCatcher { @HttpGet global static void httpGet() { ... } } and @RestResource(...
PatMcClellan__c's user avatar
0 votes
1 answer
4k views

Create a test class for RestResource class with a response code

I have a @RestResource class which receives data from a third party, finds the matching record and updates it, then returns a success/fail to the third party. I've just added the RestContext.response ...
Irene's user avatar
  • 1,885
0 votes
1 answer
143 views

APEX test script to web server with a static time stamp doget cakk and HttpGet

New to writing test scripts. Looking for help in error in Unexpected token 'Lead' for my test code. I have a static field that pulls off time stamp to only pull data after a certain time. I am ...
Khylin Edwards's user avatar
0 votes
1 answer
1k views

How does Org Namespace in Request URI work from Apex Rest Web Service Test Class?

I am having big problem understanding how namespace works in the RequestURI of Apex Rest Web Services when you deploy them as part of a managed package, and hence, writing a proper Test Class for that,...
SFDC Dev 27's user avatar
1 vote
1 answer
371 views

@HttpPost test will not run - Method does not exist or incorrect signature: void doPost(String,

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 ...
Dylan W's user avatar
  • 13
1 vote
1 answer
41 views

Test Class calling Rest Resource with List containing multiple variable types

I have a RestResource class that is called by our backend to perform a specific action. The problem is that when I attempt to test for this class, I run into a snag. The Class accepts a JSON file from ...
Juan's user avatar
  • 13
2 votes
1 answer
2k views

Test Method for @HttpPost RestResource is not returning expected results

I have been looking all over the boards and found some useful posts regarding testing rest services, but even after spending the last 2 hours trying to implement many of those ideas, I still am stuck ...
Morgan Marchese's user avatar
2 votes
1 answer
15k views

A testclass for @RestResource @HttpPost

I have a @HttpPost method in @RestResource class: @RestResource(urlMapping='/Something/*') global with sharing class HttpClass { @HttpPost global static String updateCustomObject() { //Fetching ...
Alan Abishev's user avatar