Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
1 answer
130 views

Problem with testing void HttpRequest

I can only get 23% code coverage with what I have. The http request in the method is not getting covered for some reason.. Here's what I've tried: Class: public class PostClientes { @...
Josue Rivas's user avatar
0 votes
1 answer
338 views

facing System.CalloutException for HTTP response in test class

I'm facing "System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out" Here is my codes: (Adding only the relevant code) Callout Class which ...
AjaySFDC's user avatar
  • 618
2 votes
3 answers
2k views

Sending attachment to JIRA From Salesforce Issue

I am trying to upload to JIRA from SF. I am using below code. HttpRequest req = new HttpRequest(); HttpResponse res = new HttpResponse(); Http http = new Http(); Blob headerValue = Blob....
Sunny's user avatar
  • 683
7 votes
1 answer
4k views

You have uncommitted work pending. Please commit or rollback before calling out

I have written a callout class as below.But when a account is created/updated am getting the exception like "You have uncommitted work pending. Please commit or rollback before calling out" at 36 line(...
user8376's user avatar
  • 101
6 votes
1 answer
5k views

how to get test coverage for @future and http response method in class

Below is my apex class and trigger, that is used to send sms from 3rd party application and that is working fine, but i'm not getting test coverage for class. If i use @future method my apex class ...
Sharat's user avatar
  • 1,059
2 votes
0 answers
643 views

http mock for dom document

I am using http mock method for testing responses. But as one of the class expects DOM document and use response.getBodyDocument(). Usually, I used to insert sample response for http mock. I am ...
kitokid's user avatar
  • 1,748