Factory Method Pattern for Spring Hateoas Links

Problem Description You have a single class in your application where you create Hateoas Links for different API versions (e.g.: V1 and V2). The class grows quickly with time as you add a lot of logic for those versions. You want to refactor the existing class so that it is easier to be modified for […]

How to read and override Spring Boot YAML Properties

There are some cases where we need to read and override YAML properties for implementation and testing purposes. This short tutorial will teach you how to do it. You can find the source code on GitHub. Project Structure The project structure is as follows. Reading a YAML Property There are some cases that we read […]

Testing HTTP Methods using Mockito framework

In this post, you will learn how to create HTTP methods in Spring Boot and test them using the Mockito framework. If you are not familiar with unit testing, see my post on Medium. For those who are impatient, you can find the source code on GitHub. HTTP Verbs Overview The most-commonly-used HTTP verbs are […]