Category: Spring

Consider a scenario where a database query matches over 1000 records. You need to display the query results to users. In this scenario, you probably won’t want to display all records on a single page. Instead,  you would want to display chunks of data of suitable sizes with high readability. To achieve this, you use […]Continue reading

When developing REST APIs, it is important to have accurate and well-structured documentation of your API. This documentation is the reference point for anyone who wants to use your API. Spring REST Docs helps you to achieve it. Spring REST Docs take a different approach than any other traditional tools like Swagger. For more information on […]Continue reading

MapStruct and Project Lombok are two tools which can make your life as a developer much easier. MapStruct is a slick project which generates type mappers via simple interfaces. You define an interface method to accept a source type with a return type. And MapStruct generates the implementation of the mapper. Project Lombok is a […]Continue reading

ArgumentCaptor in Mockito allows you to capture arguments passed to methods for further assertions. You can apply standard JUnit assertion methods, such as assertEquals(), assertThat(), and so on, to perform assertions on the captured arguments. In Mockito, you will find the ArgumentCaptor class in the org. mockito package If you are new to mocking with […]Continue reading

Enterprise Applications developed using the Spring Framework use different types of configuration properties to configure the application at runtime. These configuration properties help in connecting to databases, messaging systems, perform logging, caching, and lots more. It is common to store configuration properties in external .properties and .yml files. There are various ways of reading external […]Continue reading

Using API Gateways is a common design pattern with microservice architectures. API Gateways allow you to abstract the underlying implementation of the microservices. Microservices based systems typically have a large number of independent services. One challenge in such systems is how external clients interact with the services. If external clients interact directly with each microservices, […]Continue reading

A Spring Boot RESTful service is typically divided into three layers:  Repository, Service, and Controller. This layering helps to segregate the RESTful application responsibilities and enabling loose coupling between the objects. When you develop a layered RESTful application, you will also need to test the different layers. In this post, I will discuss testing Spring […]Continue reading

RabbitMQ is a common messaging broker which allows applications to connect and communicate. It’s common for services in microservices-based systems to communicate asynchronously through messaging. In order to create such a message-based system, you need a message broker, aka messaging server. A message broker can support several messaging patterns. Typically, a message sender sends a […]Continue reading