Running a Single Test or Method With Maven
1. Overview Usually, we execute tests during a Maven build using the Maven surefire plugin. This tutorial will explore how to use this plugin to run a single test class or test method. 2. Introduction...
View ArticleChange the Default Location of the Log4j2 Configuration File in Spring Boot
1. Overview In our previous tutorial on Logging in Spring Boot, we showed how to use Log4j2 in Spring Boot. In this short tutorial, we'll learn how to change the default location of the Log4j2...
View ArticleContext Path vs. Servlet Path in Spring
1. Introduction DispatcherServlet plays a significant role in Spring applications and provides a single entry point for the application. Whereas the context path defines the URL that the end-user will...
View ArticleDeploying a Java War in a Docker Container
1. Overview In this tutorial, we'll learn to deploy a Java WAR file inside a Docker container. We'll deploy the WAR file on Apache Tomcat, a free and open-source web server that is widely used in the...
View ArticleDisplay Custom Items in JavaFX ListView
1. Introduction JavaFX is a powerful tool designed to build application UI for different platforms. It provides not only UI components but different useful tools, such as properties and observable...
View ArticleRun JUnit Test Cases From the Command Line
1. Overview In this tutorial, we'll understand how to run JUnit 5 tests directly from the command line. 2. Test Scenarios Previously, we've covered how to run a JUnit test programmatically. For our...
View ArticleCassandra Partition Key, Composite Key, and Clustering Key
1. Overview Data distribution and data modeling in the Cassandra NoSQL database are different from those in a traditional relational database. In this article, we'll learn how a partition key,...
View ArticleHow to Check Field Existence in MongoDB?
1. Overview In this short tutorial, we'll see how to check field existence in MongoDB. First, we'll create a simple Mongo database and sample collection. Then, we'll put dummy data in it to use later...
View ArticleCustom Serializers in Apache Kafka
1. Introduction During the transmission of messages in Apache Kafka, the client and server agree on the use of a common syntactic format. Apache Kafka brings default converters (such as String and...
View ArticleGradle Offline Mode
1. Overview Gradle is the build tool of choice for millions of developers around the globe and is the official build tool for Android applications. We usually use Gradle to download dependencies from...
View ArticleJava Weekly, Issue 400
We're hitting issue 400 – a really cool milestone along the way. Hope the Java Weekly has been an interesting read over the years Let's jump right in. 1. Spring and Java >> Micronaut Framework 3...
View ArticleThe DTO Pattern (Data Transfer Object)
1. Overview In this tutorial, we'll discuss the DTO pattern, what it is, how, and when to use them. At the end of it, let's hope we'll know how to use it properly. 2. The Pattern DTOs or Data Transfer...
View ArticleHandling Exceptions in Project Reactor
1. Overview In this tutorial, we'll look at several ways to handle exceptions in Project Reactor. Operators introduced in the code examples are defined in both the Mono and Flux classes. However, we'll...
View ArticleConfiguring Kafka SSL Using Spring Boot
1. Introduction In this tutorial, we'll cover the basic setup for connecting a Spring Boot client to an Apache Kafka broker using SSL authentication. Secure Sockets Layer (SSL) has actually been...
View ArticleSquash the Last X Commits Using Git
1. Overview We may often hear the word “squash” when we talk about Git workflows. In this tutorial, we'll shortly introduce what Git squashing is. Then, we'll talk about when we need to squash commits....
View ArticleFormat a Milliseconds Duration to HH:MM:SS
1. Overview Duration is an amount of time expressed in terms of hours, minutes, seconds, milliseconds, and so on. We may wish to format a duration into some particular time pattern. We can achieve this...
View ArticleAccess Control Models
1. Introduction In this article, we’ll explore different access control models how to implement them in practice. 2. What’s an Access Control Model? A common requirement for applications, especially...
View ArticleJava Weekly, Issue 401
1. Spring and Java >> Saving Time with Structured Logging [reflectoring.io] Optimizing our logs for being queried – a practical guide on how to add structure to our log events. >> Soft...
View ArticleTest WebSocket APIs With Postman
1. Overview In this article, we'll create an application with WebSocket and test it using Postman. 2. Java WebSockets WebSocket is a bi-directional, full-duplex, persistent connection between a web...
View ArticleJavadoc: @version and @since
1. Overview Javadoc is a way to generate documentation in HTML format from Java source code. In this tutorial, we'll focus on the @version and @since tags in doc comments. 2. Usage Of @version And...
View Article