Spring Boot

When developing Spring Boot applications, you need to tell the Spring Framework where to look for Spring components. Using component scan is one method of asking Spring to detect Spring-managed components. Spring needs the information to locate and register all the Spring components with the application context when the application starts. What is Component Scanning…

Read More Component Scanning in a Spring Boot Application

In this tutorial, you will learn about @SpringBootTest annotation. It is this annotation that you will use to write Integration Tests for your Spring Boot application. @SpringBootTest annotation is used to create a Spring Application Context that will be used during the test. It will make Spring Framework start scanning classes of your application looking…

Read More @SpringBootTest Annotation Example

You will use @MockBean annotation to create and automatically add mocks to Spring ApplicationContext. In this tutorial, we will look at different ways you can use @MockBean annotation to create mocks. If you are testing your application with JUnit and Mockito, then there are many other useful tutorials you will find in the JUnit category of…

Read More @MockBean Annotation Example

In this tutorial you will learn how to add JUnit support to your maven-based Spring Boot application. Spring Boot Starter Test Dependency To add JUnit and Mockito support to your maven-based Spring Boot application, add the following dependency to pom.xml file. <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> The above dependency will add to your project many…

Read More Adding JUnit Support to Spring Boot Application

Starting from Spring Security version 5.7.0-M2 the WebSecurityConfigurerAdapter is deprecated. In this blog post you will find a complete code example that demonstrates how to configure HttpSecurity object to make it support User Authentication and User Authorization. Before Below is a code example that uses WebSecurityConfigurerAdapter. @EnableWebSecurity @EnableGlobalMethodSecurity(prePostEnabled = true) public class WebSecurity extends WebSecurityConfigurerAdapter{…

Read More Migrating from Deprecated WebSecurityConfigurerAdapter

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 tutorial, you will learn how to configure the Spring Boot Web MVC application to support JSP(Java Server pages) and JSTL(JSP Standard Tag Library). Video Tutorial Maven Dependencies To configure your Spring Boot application to support Spring MVC, JSP and JSTL add the following maven dependencies to the pom.xml file. Spring Web The following…

Read More Spring Web MVC – Configure JSP Support

In this tutorial, we will read user data from AWS RDS with an access token. You can have a look at the following tutorials before moving ahead. Build and deploy a Serverless Spring Boot Web Application with AWS Lambda AWS Lambda with Spring Boot – A Simple GreetMe Example Amazon Cognito User Authentication in Spring…

Read More Reading user data from AWS RDS with an access token

In this article, we will learn about RabbitMQ and explore its common use-cases. We will also walk through a step-by-step guide to implement messaging using RabbitMQ in a Spring Boot Application and will see how to publish and consume messages in a queue using RabbitMQ. So, let’s begin learning! What is a RabbitMQ? RabbitMQ is…

Read More Messaging with RabbitMQ in Spring Boot Application