Spring Framework

In this tutorial, you will learn how to generate a custom JSON Web Token(JWT) and how to add and validate custom JWT Claims using the io.jsonwebtoken library. The JWT token generated in this tutorial will be signed with a SecretKey, making it secure and tamper-proof. Also, this tutorial assumes you have prior knowledge of creating…

Read More Generate JWT. Add and Validate Custom Claims.

In this tutorial, you will learn what is Spring Cloud Vault, how to install and run HashiCorp’s Vault using three different methods: from HashiCorp website, using Homebrew, or as Docker container. What is Spring Cloud Vault? How do we store secrets safe in a distributed system? Secrets are sensitive information that you don’t want to expose…

Read More Installing and Running HashiCorp’s Vault for Spring Cloud

In this tutorial, you will learn how to return a custom error message if the conditions of the Spring Method Security are not met. To learn more about method-level security annotations read: Spring Method-Level Security with @PreAuthorize, Spring Security @Secured: Method-Level Protection, @PostAuthorize Security Annotation Example. Controller class with Spring Method Security Annotation Let’s assume…

Read More Spring Method Security: Customize Error Message

In this tutorial, you will learn about Spring Bean Scopes, an important part of the Spring Framework. You will learn what they are, how they work, and when to use them. By the end, you’ll have a clear understanding of Spring Bean Scopes, helping you build better Spring applications. Introduction to Spring Beans In the…

Read More A Guide to Spring Bean Scopes

In this tutorial, you will learn what the @Respository annotation is and how to use it in your Spring Boot applications. @Repository is a Spring annotation that indicates that the decorated class is a repository. A repository is a mechanism for encapsulating storage, retrieval, and search behaviour which emulates a collection of objects. How to…

Read More @Repository Annotation in Spring

@Component is a Spring annotation that is used to indicate that a class is a component. Components are objects that make up the structure of an application and are responsible for performing specific tasks. They are typically used to represent services, controllers, repositories, and other types of objects that are used to implement business logic…

Read More @Component Annotation in Spring

This tutorial will guide you through the process of running Unit Tests and Integration Tests separately in a Maven-based Spring Boot application. We will use the JUnit Tag feature to group our test cases and separate Unit Tests from Integration Tests. To learn more, check out the Test Java code tutorials page. Create your tests…

Read More Running Unit Tests and Integration Tests Separately in Spring Boot

Welcome, and thank you for choosing this tutorial! If you’re an absolute beginner looking to learn about integration testing for Spring Boot applications with a MySQL database server, then you’re in the right place. As you proceed through this tutorial, remember that everyone was once a beginner, and the only silly question is the one…

Read More Integration Testing with Spring Boot, MySQL and Testcontainers

In this tutorial, you will learn about the difference between two Spring Boot dependencies – Spring Boot Actuator and Spring Boot Starter Actuator. If you’re new to Spring Boot, these terms may sound confusing, but don’t worry, by the end of this tutorial, you’ll understand the difference between them. Spring Boot is a popular framework…

Read More Spring Boot Actuator vs Spring Boot Starter Actuator

In this tutorial you will learn how to enable and how to view Spring Cloud API Gateway Routes using Spring Boot Actuator. Developers use Actuator to enable API Gateway routes in order to keep track of the routes being used in their application. By exposing these routes through Actuator endpoints, developers can get valuable information…

Read More Viewing Spring Cloud API Gateway Routes with Spring Boot Actuator