Getting Started with Testcontainers for Java

Introduction In modern software development, it is crucial to write robust and reliable tests to ensure the quality of your applications. One essential aspect of testing is dealing with dependencies, such as databases or external services. Testcontainers is an excellent Java library that provides lightweight, disposable containers for running dependencies during tests. In this tutorial, … 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.

Read more

Debugging RestAssured Tests

When you run REST Assured tests, you may encounter errors such as failing assertions, incorrect responses, or unexpected behaviors. This article explains some techniques that can help you identify the root cause of these errors and fix them quickly. By debugging your tests, you can see what’s happening under the hood and find the issues that are causing the test failures.

Read more

How to use Mockito to supercharge your Java Testing

Mockito is a powerful and easy-to-use mocking framework for Java applications. With Mockito, you can easily create mock objects that simulate the behavior of real objects in your application, without actually invoking their methods. We will show at first how to plug Mockito in JUnit Tests. Then, we will integrate Mockito in Quarkus Tests.

Read more

JUnit 5 Made Easy

JUnit 5 is a powerful testing framework for Java developers, allowing you to write and run repeatable, automated tests for your code. With its clear and expressive syntax, JUnit 5 makes it easy to write tests for a wide range of scenarios and use cases, from simple unit tests to complex integration tests. In this beginner’s tutorial, we’ll cover the basics of JUnit 5 and walk through the steps of writing and running your first test.

Read more

Getting started with TestNG

TestNG is a testing framework inspired by JUnit but introducing a whole set of new functionalities. In this tutorial we will walk through the set up and execution of some example tests with TestNG.

Read more