Questions tagged [stubapi]

The tag has no usage guidance.

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

Stub rest api test negative and positive result

I have class where using insertData() method and using stub. I want insertData stub return positive and negative results. How can i do it? Inserted data also is another method which I stub. So its ...
0
votes
1answer
51 views

Custom metadata type in Stub api

I am using trying to stub my class, but I have get and set for custom metadata. I know that I cannot stub get and set. Is there exist any design for using it in stub? Or I must just hardcode it and ...
1
vote
1answer
87 views

Stub api with static methods

I have a global class with a static method which makes post callout and I want to use Stub API, but I don't get how to do it when a method is static. I understand what to do inside mock classes, but I ...
-1
votes
1answer
56 views

how to test the Rest Callout using Stub API

Hi Greetings for the day. using the below code ,I have test the Rest callouts by using Stub API .Test class has been completed with out failure but received code coverage Zero.how to test the Rest ...
2
votes
1answer
91 views

What qualifies for integration testing within Apex unit test [closed]

We have ~5k unit test running for 6-8 hrs. I want to bring down the runtime. Main contributor is the DMLs in the testsetup and DMLs in the actual class. I want to replace it with Stubbing wherever ...
1
vote
1answer
190 views

Mocking Datacloud.FindDuplicates.findDuplicates(leads) for Integration test

Would be great if someone could point me in the right direction here. I have this static method as follows... public static void createDupeMap(Lead[] leads) { CheckExistingRecords cer = new ...
2
votes
1answer
94 views

Stubbing Logger classes with methods accepting Exceptions

I recently needed to write a test that checks if an exception gets logged. We have a Logger but it's built with static methods, so it cannot be stubbed. But I didn't want to test the Logger logic, so ...
4
votes
2answers
151 views

Param is unnamed__0 if StubProvider used on interface (instead class)

I am unable to use the System.StubProvider to mock/stub a complicated Backend class of which I have no implementation but only an interface public interface ShopBackend { void initialize(); ...
3
votes
2answers
276 views

ApexMocks, Test.createStub and System.TypeException @Override specified for non-overriding method

Simple use case for ApexMocks of a Service layer class, something I've done a 100 times fflib_ApexMocks mocks = new fflib_ApexMocks(); OpportunitiesServiceImpl mockOpportunitiesService = (...
0
votes
2answers
133 views

A way to put sobjects to a relationship for faking data?

I'm trying to build a database fake using StubAPI to use in Apex tests. I want to do it to save time on Database interaction (no DMLs and SOQLs) and make tests faster. But I faced an issue with ...