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.
JUnit Testing Best Practices: Verifying No Exceptions in Your Java Code
Introduction When writing tests in Java, it’s important to verify that a method or code block behaves as expected. One of the most common things to check is whether an exception is thrown during the execution of a test. However, sometimes we also want to verify that no exception is thrown. This can be particularly … 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.
Within the entire mastertheboss organization and while accessing the website www.mastertheboss.com (the “Controller”), your privacy is one of our fundamental commitments, and therefore, we take utmost care to process your personal data in accordance with the principles set forth in the applicable legislation, including without limitation the General Data Protection Regulation no. 679/2016 (“GDPR”). The … Read more
How to wait in Java with Awaitility
The Awaitility library introduces a functional style usage to express expectations of an asynchronous system in a concise and easy to read manner. Let’s have a deep dive into it with this tutorial.
JUnit 5 Cheatsheet (2023)
This article contains a JUnit 5 Cheatsheet which you can use as handy reference to build your JUnit 5 Jupiter Tests in Java.
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.
How to assert Exceptions in JUnit
JUnit 5 provides several ways to assert that a certain exception is thrown in a @Test method. In this tutorial, we will show you how to use assert Exceptions using JUnit5 and JUnit4 Tests.
Gradle tutorial for WildFly users
This is an updated tutorial for getting started with Gradle. You will learn how to compile and assemble a Jakarta EE 10 application in a matter of minutes and we will deploy it on WildFly. Installing gradle More and more developers are turning to Gradle for creating high performance builds. There are several advantages when … 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.