Mocking a Method in the Same Test Class Using Mockito Spy
1. Overview Mocking is a very useful feature in unit testing, especially in isolating the single behavior we want to test in our method. In this tutorial, we’ll see how we can mock a method in the same...
View ArticleWays to Add JARs to Classpath in Java
1. Introduction While working on Java projects, we often rely on external libraries to write our applications. In this article, we’ll examine different methods for adding these libraries as JARs on the...
View ArticleAutomated Testing for OpenAPI Endpoints Using CATS
1. Introduction In this tutorial, we’ll explore using CATS to automate testing for REST APIs configured with OpenAPI. Writing API tests manually can be tedious and time-consuming, but CATS simplifies...
View ArticleReload SSL Certificates From HashiCorp Vault for Spring Boot
1. Overview Applications and devices use SSL certificates to secure connections. They help secure communication between the server and the client. These certificates have an expiry time and need to be...
View ArticleIntroduction to SootUp
1. Introduction In this article, we’ll examine the the SootUp library. SootUp is a library for performing static analysis on JVM code, using either the original source code or compiled JVM bytecode....
View ArticleStoring Null Values in Avro Files
1. Introduction In this tutorial, we’ll explore two ways of handling and writing to file null values when working with Apache Avro in Java. These ways of approaching null values will also allow us to...
View ArticleA Guide to Nomad Cloud Platform
1. Introduction In today’s rapidly evolving tech landscape, organizations need reliable solutions to deploy and manage applications across diverse environments, including on-premises infrastructure and...
View ArticleStructured Logging in Spring Boot
1. Overview Logging is an essential feature of any software application. It helps track the behavior of an application during runtime by recording errors, warnings, and other events. By default, a...
View ArticleFix The Compile Error: class X is public should be declared in a file named...
1. Overview As Java developers, we’ve all faced compile-time errors, and one that might trip us up is “class X is public should be declared in a file named X.java” In this quick tutorial, we’ll explain...
View ArticleUsing Hugging Face Models With Spring AI and Ollama
1. Overview Artificial Intelligence is changing the way we build web applications. Hugging Face is a popular platform that provides a vast collection of open-source and pre-trained LLMs. We can use...
View ArticleFiltering a List With Regular Expressions in Java
1. Introduction In this tutorial, we’ll learn how to create a new list from an existing one in Java by filtering the elements that match a regular expression (regex). We’ll also look at various ways to...
View ArticleJava Weekly, Issue 575
1. Spring and Java >> Do We Need Unit Tests Anymore? [petrikainulainen.net] Unit tests have lost ground in favor of integration, API, and end-to-end tests. Still, unit tests can be very much...
View ArticleIntroduction to h2o
1. Overview Machine learning is essential in modern software development. We build models with various architectures, train them using different algorithms, and achieve incredible results by improving...
View ArticleFloat vs. Double in Java
1. Overview Managing numeric data effectively is a key aspect of Java programming, as selecting the appropriate data type can greatly influence performance and accuracy. The float and double data types...
View ArticleUsing Anthropic’s Claude Models With Spring AI
1. Overview Modern web applications are increasingly integrating with Large Language Models (LLMs) to build solutions. Anthropic is a leading AI research company that develops powerful LLMs, with their...
View ArticleHow to Handle “class file has wrong version” Errors in Java
1. Overview While working with Java projects, a common error when setting up a new project or updating or adding a dependency is the “class file has wrong version” error. In this tutorial, we’ll look...
View ArticleConstraint Programming Using Choco
1. Overview In this tutorial, we’ll learn about Choco-solver, a popular Java Constraint Programming (CP) framework. Overall, we’ll briefly understand the fundamentals of CP and then look at the key...
View ArticleWorking With Reactive Kafka Stream and Spring WebFlux
1. Overview In this article, we’ll explore Reactive Kafka Streams, integrate them into a sample Spring WebFlux application, and examine how this combination enables us to build fully reactive,...
View ArticleImport CSV in Elasticsearch Using Spring Boot
1. Introduction In this tutorial, we’ll learn how to import data from a CSV file into Elasticsearch using Spring Boot. Importing data from a CSV file is a common use case when we need to migrate data...
View ArticleFixing Hibernate QueryParameterException: No Argument for Ordinal Parameter
1. Overview In this short tutorial, we’ll learn how to fix the Hibernate QueryParameterException: “no argument for ordinal parameter”. First, we’ll understand the root cause behind the exception. Then,...
View Article