Adopting ApexMocks Framework

Making quality easy

White-box testing
Photo by Kelli McClintock on Unsplash

Long time ago I wrote an article about how to use mocks to improve and simplify our day to day unit testing without the need of a specific framework. You can have a look at it here if you wish! But that should be your starting point only. For bigger or long running projects, I really encourage you using a robust framework.

I promised I was going to write an article on how to adopt the hugely beloved ApexMocks too. And actually I did it! This time I had the honour of publishing it at Ebury Labs. So if you were looking for knowing more about ApexMocks adoption, here you have it!

There are lot more interesting technology articles at the Ebury Labs blog as well as the company’s culture and open positions. Feel free to explore the content and… well probably you’re there now. I’ll stop typing just right… now!

Mocking fundamentals – simple mocks without frameworks

What you have to know before giving up with mocks

hello-i-m-nik-v8pL84kvTTc-unsplash– Photo by Hello I’m Nik 🇬🇧 on Unsplash

Maybe you have heard about the mocking technique a lot, but never understood very well how it works or doubted if it is really worthwhile. This article is aimed at those who do not know what the tests with mocks are and what they are for. I’ll focus on telling you about the pillars of such technique, why it is good for unit testing and how apply it in your application without the need of a framework.

Then, in a future post, I’ll show you the steps to progressively transition from integration tests to real unit tests and how to adopt the popular ApexMocks framework. That will really make the difference to your daily work. However, you’ll get better results if you first let the mocking principles to mature in your mind. Really exciting, isn’t it?

Continue reading “Mocking fundamentals – simple mocks without frameworks”

Clarity Driven Development

A new mindset for developers

codey meditandoMay the be with you

When one has been coding for a few years, there is a moment in which we look back and realize that our coding practices have changed dramatically. That turning point can take us to the dark side or the light side.

The dark side is not constructive. Perhaps it is our ego that speaks. We could defend the coding practices we adopted during our years of experience, maybe just because someone else said that was the way to go. Although we could be based on very solid arguments, we would be also missing the core concepts that made such reputed software engineer to define them. A Jedi uses the for knowledge and defense, never for attack. We could still be writing good enough code though (maybe by mistake :-D).

The light side is constructive. When we do an effort to make your code clean and easier to understand, we are thinking on someone, we still don’t know, that will be reading your code. We demonstrate empathy to the developer of that uncertain future. If you are one with the force, you’ll have taken those lessons, not as a recipe, but as the foundations of your own thinking. Your own style. You’ll be ready to appreciate the details and love the code written by those remarkable developers you support.

The programming tools or techniques help building scalable and maintainable software, but you should better have to take the pillars that made them a standard to follow for everyone. You would then be in the light side. Which one you choose, Jedi?

Continue reading “Clarity Driven Development”

Mastering Custom Settings

“Let the games begin”


Custom Settings feature has remained unchanged for a long time now. You’d say ‘why change something that works so good?’. Absolutely! But are you using them correctly? 

To me it’s been a long time since last time I visited the Custom Settings documentation. So I dived into it and the truth is that, it took me a couple of reads of the Custom Setting methods docs to get all the details.

At the end Custom Settings are quite easy to use once you play around a bit with them, but have some secrets you must know! I got fun finding them and I hope you do too!

Continue reading “Mastering Custom Settings”

One Batch Apex to rule them all (Part II)

Program to interfaces, not implementations

Watch Out!! Bulkified zone!!

In the firsts part of this post, we saw how to isolate the batch apex logic from the operations performed. You can find the full code in the versiononefirst repository.

But today, we are going to extend it further by making our batch apex handler able to perform a list of operations. We’ll also be adding more features and introducing some new concepts as we progress. Get ready… Let’s go!

Continue reading “One Batch Apex to rule them all (Part II)”

One Batch Apex to rule them all (Part I)

Don’t repeat yourself

If you have been working with apex some time, you’ll probably know what a Batch Apex is. Even, you probably created more than one batch apex class to support your most demanding processes, right?

But haven’t you being copying and pasting most of the code, to finally amend some bits of it? Don’t they look too similar at the end? Don’t look around, I won’t tell anybody you did it 🙂 It might not be as bad as it seems, because you probably wanted to provide the same user experience and error handling on all your processes. We’ll work on this now. Are you ready?

Continue reading “One Batch Apex to rule them all (Part I)”

Welcome to version one first!

A long journey to learning.

Recently, Simon Goodyear (Salesforce MVP), during a Salesforce DUG event, said: “Make the version one first“. That’s a good advice, isn’t it? Developers trend to be too perfectionist, indeed. We never feel happy enough with the code we are witting. We would be improving it forever! That sentence inspired me much and that’s because I’m creating this blog.

There are lot of places around the huge internet world were we, developers, can find tutorials, introductions, experiences, experiments, etc, about the Salesforce technology and development in general. Then, why another one?

Because, the three w’s have the information, but finding what you are looking for, and in the desired degree of depth, takes long. This is why I’ll be creating articles, in a level based way. As you have just guessed, there will be a place for the version one, being that the one with less knowledge requirements and followed by a more elaborated ones. Hopefully, some of them will fulfill your needs.

On the other hand, I have been seduced by the irresistible need of express my ideas and findings to the vast world of dev community. Hey mom! Look what I can do! So I’ll do a bit of therapy here 🙂

There will be a place for the other bloggers I admire much. I’ll gather here some of my very favorite blogs in my catablog.

Hope you find useful stuff here. Welcome, and enjoy!

Blog by Mikkel Flindt Heisterberg about everything and nothing - mostly appdev stuff...


Salesforce para artesanos


Useful Resources about Flow, Next Best Action, and More

Automation Champion

Automating Salesforce One Click at a Time


Dissecting the runtime, one bite at a time

Valerio Sevilla

Software & Indie Game Developer

Carol Code and Vogue

A little bit of everything and some code


Stephen Willcock on

Douglas C. Ayers

My journey with Salesforce and Technology

Andy in the Cloud

From BBC Basic to and beyond...

The Silver Lining

Lessons & Learnings from a salesforce certified technical architect.

Agustina odeian

Loving the cloud with a sky without clouds

Code 4 Cloud

Coding for the Platform