This article covers the integration between JUnit 5, the well-known framework for Java testing, with JBang scripting tool. By the end of it, you will learn how to add a robust testing layer to your Java scripts written with JBang.
Various Stuff
JMeter DSL: How to Load Test from your code
Performance testing is crucial in ensuring the reliability and scalability of software systems. However, traditional approaches to performance testing often treat it as a separate phase, leading to delayed feedback and issues surfacing late in development. Continuous Performance Testing aims to address this by integrating performance tests into the development pipeline, providing early insights into … Read more
Getting started with JUnit 5 TestSuite
JUnit 5 provides powerful features for organizing and running tests efficiently. Test Suites, a collection of tests bundled together, allow you to execute multiple test classes or methods in one go. In this article we will show a step-by-step guide to create a JUnit 5 TestSyite with some practical examples. How to declare a JUnit … Read more
How to visualize H2 Database with IntelliJ Idea
In this article we will learn how to visualize an H2 Database using an IntelliJ free plugin that you can add to your IDE. By installing this plugin, you will also be able to insert SQL Statements from the SQL Console.
Testing JPA with TestContainers
Testcontainers is an open-source Java library that simplifies integration testing by providing lightweight, disposable containers for database systems, message brokers, and other third-party services. In this article we will learn how to combine Testcontainer with a JPA/Hibernate Test case.
How to connect to an H2 Database from Java
In this article we will show an example to to connect to an H2 Database from Java. At first, we will use create a Java example for the Embedded H2 Database. Then, we will modify the example to connect to a remote H2 Database.
How to fix “No ParameterResolver registered for parameter”
The error message you’re encountering, “No ParameterResolver registered for parameter x” is due to the incorrect usage of annotations in the JUnit 5 test.
In JUnit 5, @ParameterizedTest
is used to indicate that the annotated method is a parameterized test. However, it seems like in your code snippet, the @ParameterizedTest
annotation is mistakenly combined with @Test
, causing confusion in the framework.
Here’s a step-by-step tutorial on how to fix this issue:
How to solve CVE-2023-44487
The CVE-2023-44487 vulnerability can be exploited by multiplexing requests through the HTTP/2 protocol and rapidly resetting the streams. This chain of events will result in high server resource consumption and eventually cause a Denial of Service. Let’s see which packages are affected and the current resolution or mitigation of the issue. HTTP/2 RESET of Connections … Read more
How to Test Private Methods with JUnit
When writing unit tests, the best practice is to test public methods, as they are the entry points to your classes and provide the intended behavior to external consumers. Testing private methods, on the other hand, is often considered an implementation detail and not directly exposed to the external API. In this article, we will discuss why testing private methods is not generally a good option and explore an approach to test them using JUnit 5.
Why JUnit5 Tests are not running? [Solved]
So your JUnit 5 Jupiter Tests are not running in Maven ? no panic! This tutorial will provide all the checks you need to apply to your Maven project to unlock your JUnit 5 test execution.