Тёмный

Salesforce SoC and Apex Common Tutorial Series: Ep 17 - Implementing Unit Testing with Apex Mocks 

Coding With The Force
Подписаться 15 тыс.
Просмотров 3 тыс.
50% 1

Опубликовано:

 

14 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 16   
@robertdillon2460
@robertdillon2460 3 года назад
An awesome piece of work, very much appreciated!
@stevenduong8126
@stevenduong8126 2 года назад
Thanks so much for sharing. Your wiki is only resource to recall when I need.
@jpateusa77
@jpateusa77 2 года назад
My team and I thank you for all you do.
@ItsMeUrsFa-pw7yj
@ItsMeUrsFa-pw7yj 2 года назад
Nice into music too 👌
@CodingWithTheForce
@CodingWithTheForce Год назад
I wasted an entire week just picking the music for that intro, woulda launched my channel two months earlier but I spent a lot of time designing and building that intro lol
@samsilva6602
@samsilva6602 3 года назад
Nice work! Thank you for sharing it! Quick question, how do we actually cover the Selector layer since it is all mocked? hm I mean, we dont actually test other classes than the one we are working on, so how to get the selector layer covered and tested? Should we create regular test class for the selector layer?
@CodingWithTheForce
@CodingWithTheForce 3 года назад
Good question! Sorry it took me so long to respond, but yes you should just create regular integration tests for selector layer classes, no need to create unit tests or do any mocking for them.
@petargechev1852
@petargechev1852 2 года назад
@rajusen-w8u
@rajusen-w8u 9 месяцев назад
How can we mock a future method, it runs locally , on unlocked package creation it cannot find the implementation for the interface?
@lditzel
@lditzel 2 года назад
Can you "install" this library just by copying its corresponding files? I'm using an .sh file to generate scratch orgs and it's really annoying to deploy the package every time I create a new one, and also I want to keep libraries tracking within my repo. Thanks a lot for this series btw, It was amazingly helpful!
@CodingWithTheForce
@CodingWithTheForce 2 года назад
Yep you can, just copy the files from the Apex Mocks repo and you're good to go! All the files you need are located here: github.com/apex-enterprise-patterns/fflib-apex-mocks/tree/master/sfdx-source/apex-mocks
@marianacelestrino4310
@marianacelestrino4310 2 года назад
heeey, do you know if its possible to mock metadata when using the getAll().values() methods? thank you!
@CodingWithTheForce
@CodingWithTheForce 2 года назад
You can mock metadata as long as you create a selector class for the metadata, which I would personally suggest doing. That said, queries for metadata are lightning fast compared to queries for regular data so you don’t gain as much benefit speed wise in testing.
@marianacelestrino4310
@marianacelestrino4310 2 года назад
@@CodingWithTheForce Is what I was planning to do, also to avoid dml operations as well. Thank you for the videos and for the answer!!
@biswajitsamantaray3117
@biswajitsamantaray3117 3 года назад
Hi friend, Do these library support dynamic apex? For simplicity I always saw you passing like Case.sObjectType and all 😅
@CodingWithTheForce
@CodingWithTheForce 3 года назад
Kind of yes and kind of no. This is maybe too complicated a topic for a comment. I will try to produce something to explain it a bit in the near future. Basically you have to use an interface in your selectors to dynamically change your query on an object by object basis. So it's not dynamic soql in the literal sense, but it does allow you to dynamically generate queries based on the incoming object/situation.
Далее
Kubernetes 101 workshop - complete hands-on
3:56:03
Просмотров 1,6 млн