Cucumber is a popular open-source tool that supports Behavior-Driven Development (BDD) for testing software applications in Java. BDD emphasizes collaboration between developers, testers, and stakeholders by writing test scenarios in a readable, plain English language called Gherkin. This tutorial will guide you through the basics of setting up and writing your first Cucumber test in Java.
Testing Java
JUnit 5: Using Custom DisplayNames for Tests
JUnit 5 provides a powerful feature called @DisplayName
, which allows you to customize the display name of your tests for better readability. In this tutorial, we will explore how to take control of your test names using the JUnit 5 DisplayNameGenerator
. This feature enables you to create expressive, informative, and dynamic test names, making your test suite more readable and maintainable.
TestContainers made simple with JBang
This article discusses how to execute Tests on Container Images using JBang as Java scripting tool and TestContainers + JUnit 5 Jupiter as Test library.
How to run JUnit 5 Tests with JBang
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.
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
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 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 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.