Cucumber and Spring Boot Integration: Passing Arguments To Step Definitions Explained

Cucumber is a tool that supports Behavior-Driven Development (BDD). In this blog, you will learn how to pass arguments to step definitions when using Cucumber and Spring Boot. Enjoy!

Introduction

In a previous post, Cucumber was introduced as a tool that supports Behavior-Driven Development (BDD). Some of the features were explained, but not how to pass arguments to step definitions. In this blog, you will learn how you can do so. The application under test is a Spring Boot application. You will also learn how you can integrate the Cucumber tests with Spring.

Effective Java Application Testing With Cucumber and BDD

Increase your testing efficiency by utilizing Cucumber for Java application testing, fully integrated with Behavior-Driven Development (BDD). This guide provides comprehensive steps for project setup, scenario writing, step implementation, and reporting.

Introduction

Cucumber is a tool that supports Behavior-Driven Development (BDD). A good starting point in order to learn more about BDD and Cucumber, are the Cucumber guides. BDD itself was introduced by Dan North in 2006, you can read his blog introducing BDD. Cucumber, however, is a tool that supports BDD, this does not mean you are practicing BDD just by using Cucumber. The Cucumber myths is an interesting read in this regard.

Implement RAG Using Weaviate, LangChain4j, and LocalAI

In this blog, you will learn how to implement Retrieval Augmented Generation (RAG) using Weaviate, LangChain4j, and LocalAI. This implementation allows you to ask questions about your documents using natural language. Enjoy!

1. Introduction

In the previous post, Weaviate was used as a vector database in order to perform a semantic search. The source documents used are two Wikipedia documents. The discography and list of songs recorded by Bruce Springsteen are the documents used. The interesting part of these documents is that they contain facts and are mainly in a table format. Parts of these documents are converted to Markdown in order to have a better representation. The Markdown files are embedded in Collections in Weaviate. The result was amazing: all questions asked, resulted in the correct answer to the question. That is, the correct segment was returned. You still needed to extract the answer yourself, but this was quite easy.

Semantic Search With Weaviate Vector Database

In a previous blog, the influence of the document format and the way it is embedded in combination with semantic search was discussed. LangChain4j was used to accomplish this. The way the document was embedded has a major influence on the results. This was one of the main conclusions. However, a perfect result was not achieved. 

In this post, you will take a look at Weaviate, a vector database that has a Java client library available. You will investigate whether better results can be achieved.

How To Embed Documents for Semantic Search

In this post, you will take a closer look at embedding documents to be used for a semantic search. By means of examples, you will learn how embedding influences the search result and how you can improve the results. Enjoy!

Introduction

In a previous post, a chat with documents using LangChain4j and LocalAI was discussed. One of the conclusions was that the document format has a large influence on the results. In this post, you will take a closer look at the influence of source data and the way it is embedded in order to get a better search result.

How To Use LangChain4j With LocalAI

In this post, you will learn how you can integrate Large Language Model (LLM) capabilities into your Java application. More specifically, how you can integrate with LocalAI from your Java application. Enjoy!

Introduction

In a previous post, it was shown how you could run a Large Language Model (LLM) similar to OpenAI by means of LocalAI. The Rest API of OpenAI was used in order to interact with LocalAI. Integrating these capabilities within your Java application can be cumbersome. However, since the introduction of LangChain4j, this has become much easier to do. LangChain4j offers you a simplification in order to integrate with LLMs. It is based on the Python library LangChain. It is therefore also advised to read the documentation and concepts of LangChain since the documentation of LangChain4j is rather short. Many examples are provided though in the LangChain4j examples repository. Especially, the examples in the other-examples directory have been used as inspiration for this blog.

Running LLMs Locally: A Step-by-Step Guide

In this post, you will take a closer look at LocalAI, an open-source alternative to OpenAI that allows you to run LLMs on your local machine. No GPU is needed: consumer-grade hardware will suffice. Enjoy!

Introduction

OpenAI is a great tool. However, you may not be allowed to use it due to company policies because you might send sensitive information to OpenAI. Besides that, you might want to experiment with different kinds of LLMs (Large Language Models). Wouldn’t it be great if you could run models locally using the same Rest API as for OpenAI? Well, that is exactly what LocalAI has to offer you! LocalAI is an open-source alternative to OpenAI and has a Rest API which is compatible with the OpenAI API specifications. Besides that, no GPU is needed, you can run it on consumer-grade hardware. It is advised, however, to use a GPU, because it will be approximately 20 times faster.

How to Monitor a Spring Boot App With Ostara

In this blog, you will learn how to monitor a Spring Boot application using Ostara. Ostara is a desktop application that monitors and manages your application. Enjoy!

Introduction

When an application runs in production (but also your other environments), it is wise to monitor its health. You want to make sure that everything is running without any problems, and the only way to know this is to measure the health of your application. When something goes wrong, you hopefully will be notified before your customer notices the problem, and maybe you can solve the problem before your customer notices anything. In a previous post, it was explained how to monitor your application using Spring Actuator, Prometheus, and Grafana. In this post, you will take a look at an alternative approach using Spring Actuator in combination with Ostara. The setup with Ostara is a bit easier; therefore, it looks like a valid alternative. The proof of the pudding is in the eating, so let’s try Ostara!

How To Generate Spring Properties Documentation

Are you struggling to keep the documentation of your Spring configuration properties in line with the code? In this blog, you will take a look at the Spring Configuration Property Documenter Maven plugin, which solves this issue for you. Enjoy!

Introduction

Almost every Spring (Boot) application makes use of configuration properties. These configuration properties ensure that certain items in your application can be configured by means of an application.properties (or YAML) file. However, there is also a need to document these properties in order for someone to know what these properties mean, how to use them, etc. This is often documented in a README file. This README file needs to be manually maintained while the properties are present in a Java class which also contains documentation and annotations.

Podman Desktop Review

In this blog, you will take a closer look at Podman Desktop, a graphical tool when you are working with containers. Enjoy!

Introduction

Podman is a container engine, just as Docker is. Podman commands are to be executed by means of a CLI (Command Line Interface), but it would come in handy when a GUI would be available. That is exactly the purpose of Podman Desktop! As stated on the Podman Desktop website: “Podman Desktop is an open source graphical tool enabling you to seamlessly work with containers and Kubernetes from your local environment.”

Spring Boot Configuration Properties Explained

Do you also get lost in the configuration annotations of Spring Boot and how to use them? In this blog, you will take a look at the configuration annotations, what they mean, and how you can apply them in your code — everything is explained by means of examples. Enjoy!

Introduction

The annotations containing the word configuration in Spring Boot can be overwhelming. You have @Configuration, @EnableConfigurationProperties, @ConfigurationPropertiesScan, etc. But what do they actually do, and how do you need to apply them in your code?

Podman Compose vs Docker Compose

In this blog, you will take a look at Podman Compose. With Podman Compose, you can use compose files according to the Compose Spec in combination with a Podman backend. Enjoy!

Introduction

A good starting point and a must-read is this blog provided by RedHat. In short, Podman Compose is not directly maintained by the Podman team, and neither is Docker Compose, of course. Podman Compose has a more limited feature set than Docker Compose and in general, it is advised to use Kubernetes YAML files for this purpose. See "Podman Equivalent for Docker Compose" for how this can be used. However, the Podman team will fix issues in Podman when required for Podman Compose. It is also possible to use Docker Compose in combination with Podman, as is described in the post "Use Docker Compose with Podman to Orchestrate Containers on Fedora Linux."

Podman Equivalent for Docker Compose

In this blog, you will learn how to use Podman with the built-in equivalent for Docker Compose. You will learn how to use Podman kube play and how to deploy your Podman pod to a local Minikube cluster. Enjoy!

Introduction

The first reaction to the short intro will be: “You need to use Podman Compose for that!” However, this blog is not about Podman Compose, but about using the basic concept of Podman by using pods and deploying them to a Kubernetes cluster. Podman Compose is a different concept and deserves its own blog.

Is Podman a Drop-in Replacement for Docker?

In many places, you can read that Podman is a drop-in replacement for Docker. But is it as easy as it sounds? In this blog, you will start with a production-ready Dockerfile and execute the Podman commands just like you would do when using Docker. Let’s investigate whether this works without any problems!

Introduction

Podman is a container engine, just as Docker is. Podman, however, is a daemonless container engine, and it runs containers by default as rootless containers. This is more secure than running containers as root. The Docker daemon can also run as a non-root user nowadays.

What Is JHipster?

In this blog, you will learn more about JHipster and how it can help you with developing modern web applications. Enjoy!

1. Introduction

JHipster is a development platform that helps you quickly set up an application. It goes beyond setting up a project structure: JHipster will generate code, database tables, CRUD (Create, Read, Update, Delete) webpages, unit and integration tests, etc.

How To Create a GraalVM Docker Image

In this post, you will learn how to create a Docker image for your GraalVM native image. By means of some hands-on experiments, you will learn that it is a bit trickier than what you are used to when creating Docker images. Enjoy!

Introduction

In a previous post, you learned how to create a GraalVM native image for a Spring Boot 3 application. Nowadays, applications are often distributed as Docker images, so it is interesting to verify how this is done for a GraalVM native image. A GraalVM native image does not need a JVM, so can you use a more minimalistic Docker base image for example? You will execute some experiments during this blog and will learn by doing.

How To Build a Spring Boot GraalVM Image

In this article, you will learn how to build a GraalVM image for your Spring Boot application. Following these practical steps, you will be able to apply them to your own Spring Boot application. Enjoy!

Introduction

Java is a great programming language and is platform independent. Write once, run anywhere! But this comes at a cost. Java is portable because Java compiles your code to bytecode. Bytecode is computer object code, which an interpreter, (read: Virtual Machine), can interpret and convert to machine code. When you start your Java application, the Virtual Machine will convert the bytecode into bytecode specific for the platform, called native machine code. This is done by the just-in-time compiler (JIT). As you will understand, this conversion takes some time during startup.

How To Use Ansible Roles

In this article, you will learn the basics of Ansible Roles. With Ansible Roles, you can reuse Ansible content you create and share them with other users. You will learn about Ansible Roles step-by-step by means of examples. Enjoy!

Introduction

In the three previous Ansible posts, you learned how to setup an Ansible test environment, how to create an Ansible inventory, and how to create an Ansible playbook.