Blog

String validation plays a crucial role in Java programming as it helps ensure the correctness and reliability of data processing. Strings are fundamental data types used to store text-based information, such as user inputs, file contents, or database values. However, these strings can often be empty, null, or contain only whitespace characters, which can lead…

Read More Check if a String is Null, Empty or Blank in Java

In this tutorial, you will learn about @SpringBootTest annotation. You will use this annotation 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 scan your application classes and look for different annotations. Depending…

Read More @SpringBootTest Annotation Example

In this blog post, you will learn how to add user Roles and Authorities to a JWT token issued by the new Spring Authorization Server. When writing this tutorial, I assumed you are familiar with the new Spring Configuration Server setup. Otherwise, please check the Spring Authorization Server tutorial first. Adding Granted Authorities to JWT To include…

Read More Add Roles to JWT Issued by Spring Authorization Server

In this blog post, you will learn the difference between @SpringBootTest and @WebMvcTest annotations. The main difference between the @SpringBootTest and @WebMvcTest annotations lies in the application context that they create. The @SpringBootTest annotation starts the full application context, which includes all the beans required for the application to function. On the other hand, the…

Read More Difference Between @SpringBootTest and @WebMvcTest

In this blog post, you will learn a couple of ways you can disable Spring Security Configuration for your @WebMvcTest. Disable Security Filters for @AutoConfigureMockMvc One of the ways you can disable Spring Security filters in your tests, is to use the @AutoConfigureMockMvc annotation. @AutoConfigureMockMvc annotation can be applied to a test class to enable…

Read More Disable Spring Security Configuration for @WebMvcTest