How to Check For a Logged Message in a Spock Test
1. Introduction As our code executes we often log events of interest. Some of those events are important enough that we want to ensure that our message is logged. In this tutorial, we’ll learn how to...
View ArticleNull Array to Empty List in Java
1. Overview In Java programming, simplicity often hides behind the handling of null values, especially when dealing with arrays. Likewise, converting a potentially null array to an empty List isn’t...
View ArticleJava Weekly, Issue 578
1. Spring and Java >> Building Effective Agents with Spring AI (Part 1) [spring.io] Explore basic design patterns for implementing LLM-based systems, with practical examples using Spring AI....
View ArticleValidate List of Values in Spring
1. Overview The process of validating various values is critical in software development. It ensures that the data flowing into our application is correct and consistent. Validations can be applied to...
View ArticleConvert Camel Case to Snake Case in Java
1. Overview Camel and snake cases are two common naming conventions often used in programming. While the camel case utilizes capital letters to signify the start of a new word (camelCaseExample), the...
View ArticleIntroduction to JLine 3
1. Introduction JLine is a library for handing console input, giving us similar abilities to the GNU readline library or the ZSH line editor. In this tutorial, we’ll examine JLine 3, learning what it...
View ArticleConvert Mono Object to Another Mono Object in Spring WebFlux
1. Introduction Spring WebFlux is a reactive programming framework that facilitates asynchronous, non-blocking communication. A key aspect of working with WebFlux is handling Mono objects, representing...
View ArticleMock JWT with JwtDecoder in JUnit Test
1. Overview In this tutorial, we’ll explore how to effectively mock JWT (JSON Web Token) for unit testing Spring Security applications that use JWT authentication. Testing JWT-secured endpoints often...
View ArticleGenerate All Possible IP Addresses From Given Numeric String in Java
1. Overview In this tutorial, we’ll explore different ways to generate all possible IP Addresses from a given numeric string in Java. This problem is a common interview question. We’ll first deep-dive...
View ArticleRemove Insignificant Zeros From a Number Represented as a String
1. Introduction In this tutorial, we’ll learn how to remove insignificant zeros from a number represented in a String, including leading and trailing zeros. We’ll explore several ways to achieve this,...
View ArticleWhy super.super.method() is Not Allowed in Java
1. Overview In Java, inheritance is a powerful mechanism for reusing and extending functionalities across classes. By leveraging the super keyword, we can access the methods and properties of a parent...
View ArticleJUL to SLF4J Bridge
1. Introduction JUL is Java’s built-in logging framework. It’s simple to use but lacks the flexibility and advanced features offered by modern alternatives. For this reason, many applications choose...
View Article