I have this simple little @HttpGet method.
@HttpGet
global static List<Case> getCases() {
RestRequest req = RestContext.request;
RestResponse res = RestContext.response;
String accountId = req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
List<case> result = [SELECT Id, Type, caseNumber, Subject, Status
FROM CASE
WHERE AccountID = :accountId
AND isClosed = false
ORDER BY LastModifiedDate DESC
LIMIT 3];
return result;
}
which works fine but I don't know how to write a test class for it. I've successfully written test classes for the rest of my code but I can't find an example or documentation that covers this example.
Thank you in advance.