Using TDD to code a small API with Spring Boot 2

This post goes to all those devs that have heard about TDD methodology but have not tried it yet. We will follow the REDGREENREFACTOR cycle to build a really small API to save users to a database that will help you get started with this methodology. If you don’t know what TDD is about, I reccommend the following articles:

TDD Flow
Image taken from:

If you get lost during the process, you can find the source code for this API in

I strongly suggest you do not copy-paste my code, and write it by yourself, so you see how the IDE behaves as errors come up and feel the whole experience of doing TDD. Let’s start!

Read more