Wow, this is exactly what I needed. I need multiple methods to test different status codes and the guide I was following hard codes the status values in the Mock class. I needed this, thanks so much!
@ProgrammingMadeEasy992 жыл бұрын
Welcome and thanks for supporting
@AnkitSharma-ok7ll2 жыл бұрын
This is a very nice explanation of how test class donot allow to call actual endpoint. Many Many thanks.
@ProgrammingMadeEasy992 жыл бұрын
Thanks
@chidinjoku11012 жыл бұрын
Certainly not a waste of time. Thank you very much. Much appreciated.
@prakashmp39157 ай бұрын
very good example..
@ratikeshgaonkar3621 Жыл бұрын
Good One
@antimonyrocks39397 ай бұрын
Hi, very informative video! I have a doubt though. I have a class which makes an api call. I have the secret key and service url stored in custom metadata. My class retrieves this as a map from the metadata. How do I do the testing for such a class?
@ProgrammingMadeEasy997 ай бұрын
Simply just create the desired output or copy the value from the response of that Api. In test ass it will auto pull the metadata info. You just need to call the associated Apex method with necessary params that you might have created and u are good to go. Hope this helps.
@Danny-oo4df Жыл бұрын
What if we have to test multiple methods ? Can we put mock code in @testSetup annotation to made these available for all methods in test class?
@ProgrammingMadeEasy99 Жыл бұрын
Yes in test setup u can put all of them like say 3 account records with different record types etc as per requirement in the corresponding methods u can query them .