Skip to main content

New answers tagged

0 votes

Test Class for Approval Process - Problem with ProcessInstanceWorkItem

In your test method you just instantiated req1, but it seems you didn't processed/saved it. You could try: Approval.ProcessResult result = Approval.process( req1 ); I believe this would create a ...
Ramon Kowalski's user avatar
0 votes

Maximum stack depth has been reached when testing

Well, the responses have been flooding in. In the meantime, I refactored and removed the SuppressionQueue class that was in the end was unnecessary. Since the classes doing the DML were Queueable ...
Zac's user avatar
  • 1
0 votes

Unit test - handleMethodCall - how to specify the return type?

Ok, I've solved by the problem by adding if (returnType.getName() == 'String') { return 'test'; } else { return null; } But in the same time I still don't understand how ...
mathiscomplex's user avatar
0 votes
Accepted

Getting error: This class name's value is invalid: MyNamespace.CampaignControllerTest. Provide the name of an Apex class that has test methods

I wanted to post this as I think it is now working. It was really quite painful to get to the answer. Based on my original setup I had to do two things. Firstly, I had to add meta files. I had my ...
zeiddev's user avatar
  • 115
0 votes
Accepted

ApexMocks throwing System.TypeException: Class IEmailService__sfdc_ApexStub must implement the method

The reason is the Exception e as the method parameter. This is not a fflib-apex-mocks limitation, it's generic to Salesforce. I still would love to know why though. The workaround I thought of is to ...
Francesco Pitzalis's user avatar
2 votes
Accepted

Uncommitted work pending issue in Test using - System.runAs()

Test.startTest() documentation states Any code that executes after the call to startTest and before stopTest is assigned a new set of governor limits. You currently have a dml, TestDataFactory....
RubenDG's user avatar
  • 9,567
1 vote
Accepted

Apex test using ConnectApi stub mock consistently fails with no matching item error

I submitted a case with Salesforce and they said ConnectApi.ContentHub.setTestAddRepositoryItem needs to be called with the same ConnectApi.BinaryInput object reference as ConnectApi.ContentHub....
TemporaryFix's user avatar
  • 3,017
0 votes
Accepted

How to generate apex tests (for old apex classes) with TestDataFactory included

It turned out, it is easy enough asking AgentForce to use our own test data factory in prompts. What's more we can even ask to generate new test data factory method in the factory class for objects ...
tamastom's user avatar

Top 50 recent answers are included