Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Force.com Enterprise Architecture. - Second Edition

You're reading from  Force.com Enterprise Architecture. - Second Edition

Product type Book
Published in Mar 2017
Publisher Packt
ISBN-13 9781786463685
Pages 504 pages
Edition 2nd Edition
Languages

Table of Contents (23) Chapters

Force.com Enterprise Architecture - Second Edition
Credits
Foreword
About the Author
Acknowledgements
About the Reviewers
www.PacktPub.com
Customer Feedback
Preface
1. Building, Publishing, and Supporting Your Application 2. Leveraging Platform Features 3. Application Storage 4. Apex Execution and Separation of Concerns 5. Application Service Layer 6. Application Domain Layer 7. Application Selector Layer 8. User Interface 9. Lightning 10. Providing Integration and Extensibility 11. Asynchronous Processing and Big Data Volumes 12. Unit Testing 13. Source Control and Continuous Integration Index

Writing Unit Tests with the Apex Stub API


The Apex Stub API applies only within an Apex test context. So it cannot be used to implement DI outside of tests. For this you still need to leverage Apex interfaces.

Utilizing the APIs requires an understanding of the following:

  • Implementing the Stub Provider interface: The System.StubProvider system-provided Apex interface is effectively a callback style interface. It allows your mocking code to be informed when method calls are against classes you are mocking in your test. You can implement this interface multiple times, once per class you're mocking, or a single implementation for building sophisticated generalized mocking frameworks. The Apex Mocks open source framework from FinancialForce.com is one such framework that we will be reviewing later.

  • Dynamic Creation of Stubs for Mocking: The platform automatically creates instances of classes you wish to mock through the Test.createStub method. You do not need to create Apex interfaces to perform...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}