Author: Reham Muzzamil

Mocking a static or private method is often necessary when writing unit tests. However, before Mockito 3.4.0, it was impossible to explicitly mock static methods. Thus, PowerMock offers solutions to the defined use case. In this article, we will look at the introduction of PowerMock and explore examples of mocking private, static, and final methods.…

Read More A Guide to Mocking Private and Static Methods Using PowerMock

In this article, we will learn about Many-to-Many relationships in JPA and how to implement them in a Spring Boot application. Let’s get started! @ManytoMany annotation A many-to-many relationship occurs when multiple records in one table are associated with multiple records in another table. The @ManyToMany annotation is used to define a many-valued association with…

Read More Many-to-Many Relationship in Spring Boot Rest with JPA

In this article, we will cover the basics of Aspect-Oriented Programming (AOP). You will learn how to use AspectJ to provide different AOP advices to Spring Boot applications to support cross-cutting issues like logging, profiling, caching, and transaction management and finally we will do a practical implementation to record user operations using Spring Boot AOP.…

Read More A guide to Spring Boot AOP to Record User Operations

In this guide, you will learn to use @RepeatedTest and @ParametrizedTest annotations introduced in JUnit 5. We’ll look at the capability that lets us run a test a certain number of times.  We’ll also look at interfaces that will allow us to retrieve information about the repeated tests.  Moreover, we will also look at a…

Read More A Guide to @RepeatedTest and @ParametrizedTest in JUnit 5

In this article, you will learn about RabbitMQ and explore its common use cases. I will also guide you step-by-step on how to implement messaging using RabbitMQ in a Spring Boot application. By the end of this article, you will know how to publish and consume messages in a queue. So let’s get started! What…

Read More Messaging with RabbitMQ in Spring Boot Application

In the previous blog post, we have covered how to grant access to certain endpoints based on the Role configured through code. As we know, Keycloak is the Identity and Access Management solution that provides out-of-the-box authentication and authorization services. One of the services includes a Fine-Grained Authorization Service. Fine-Grained Authorization Service provides businesses with…

Read More Fine-grained Authorization Services in Keycloak with Spring Boot

In the previous blog post, we covered the basics of how to use Keycloak with Spring boot. In this blog post, we will explore Role-based Access Control to Rest API with Keycloak. So let’s get started! Imagine we have a microservice for a Research Journal Management System that can serve users with two types of…

Read More Role-Based Access Control to REST API with Keycloak

This tutorial will teach you how to use Keycloak to secure your Spring Boot Application. To find other tutorials, check the Keycloak tutorials page. What is Keycloak? According to Keycloak’s  official website, It is an open-source Identity and Access Management solution aimed at modern applications and services. It makes it easy to secure applications and…

Read More A Guide to use Keycloak with Spring Boot