Extending an Array’s Length
1. Overview In this tutorial, we’ll take a look at the different ways in which we can extend a Java array. Since arrays are a contiguous block of memory, the answer may not be readily apparent, but...
View ArticleJava Weekly, Issue 279
Here we go… 1. Spring and Java >> Analyzing dependencies in IntelliJ IDEA [vojtechruzicka.com] A couple of solid Maven tools available to IntelliJ IDEA Ultimate users — the Dependency Structure...
View ArticleGuide to Maven Profiles
1. Overview Maven profiles can be used to create customized build configurations, like targeting a level of test granularity or a specific deployment environment. In this tutorial, we’ll learn how to...
View ArticleConvert Time to Milliseconds in Java
1. Overview In this quick tutorial, we’ll illustrate multiple ways of converting time into Unix-epoch milliseconds in Java. More specifically, we’ll use: Core Java’s java.util.Date and Calendar Java...
View ArticleWriting Clojure Webapps with Ring
1. Introduction Ring is a library for writing web applications in Clojure. It supports everything needed to write fully-featured web apps and has a thriving ecosystem to make it even more powerful. In...
View ArticleGuide to FastUtil
1. Introduction In this tutorial, we’ll be looking at the FastUtil library. First, we’ll code some examples of its type-specific collections. Then, we’ll analyze the performance that gives FastUtil its...
View ArticleMulti-Module Maven Application with Java Modules
1. Overview The Java Platform Module System (JPMS) adds more reliability, better separation of concerns, and stronger encapsulation to Java applications. However, it’s not a build tool, hence it lacks...
View ArticleBatch Insert/Update with Hibernate/JPA
1. Overview In this tutorial, we’ll look at how we can batch insert or update entities using Hibernate/JPA. Batching allows us to send a group of SQL statements to the database in a single network...
View ArticleRun JAR Application With Command Line Arguments
1. Overview Typically, every meaningful application includes one or more JAR files as dependencies. However, there are times a JAR file itself represents a standalone application or a web application....
View ArticleRestTemplate Post Request with JSON
1. Introduction In this tutorial, we’ll illustrate how to use Spring’s RestTemplate to make POST requests sending JSON content. 2. Setting Up the Example Let’s start by adding a simple Person model...
View ArticleGuide to Classgraph Library
1. Overview In this brief tutorial, we’ll talk about the Classgraph library — what it helps with and how we can use it. Classgraph helps us to find target resources in the Java classpath, builds...
View ArticleGuide to QuarkusIO
1. Introduction Today, it’s very common to write an application and deploy to the cloud and not worry about the infrastructure. Serverless and FaaS have become very popular. In this type of...
View ArticleVoid Type in Java
1. Overview As Java developers, we might have encountered the Void type at some occasion and wondered what was its purpose. In this quick tutorial, we’ll learn about this peculiar class and see when...
View ArticleSkipping Tests with Maven
1. Introduction Skipping tests is often a bad idea. However, there are some situations where it could be useful — maybe when we’re developing new code and want to run intermediate builds in which the...
View ArticleCreate a Java Command Line Program with Picocli
1. Introduction In this tutorial, we’ll approach the picocli library, which allows us to easily create command line programs in Java. We’ll first get started by creating a Hello World command. We’ll...
View ArticleDefining JPA Entities
1. Introduction In this tutorial, we’ll learn about the basics of entities along with various annotations that define and customize an entity in JPA. 2. Entity Entities in JPA are nothing but POJOs...
View ArticleJUnits Tagging and Filtering Tests
1. Overview It’s very common to execute all our JUnits automatically as a part of the CI build using Maven. This, however, is often time-consuming. Therefore, we often want to filter our tests and...
View ArticleMockito Strict Stubbing and The UnnecessaryStubbingException
1. Overview In this quick tutorial, we’ll learn about the Mockito UnnecessaryStubbingException. This exception is one of the common exceptions we’ll likely encounter when using stubs incorrectly. We’ll...
View ArticleGet the Path of the /src/test/resources Directory in JUnit
1. Overview Sometimes during unit testing, we might need to read some file from the classpath or pass a file to an object under test. Or, we may have a file in src/test/resources with data for stubs...
View ArticleAuthenticating with Amazon Cognito Using Spring Security
1. Introduction In this tutorial, we will look at how we can use Spring Security‘s OAuth 2.0 support to authenticate with Amazon Cognito. Along the way, we’ll briefly take a look at what Amazon Cognito...
View Article