How to run JUnit5 tests in order
HOME The general practices say that automated tests should be able to run independently and with no specific order, as well as the result of the test should not depend on the results of previous tests. But there are situations where a specific order of test execution can be justified, especially in integration or end-to-end … Continue reading How to run JUnit5 tests in order
How to disable tests in JUnit5 – @Disabled
HOME JUnit5 also provides the support to exclude/disable the tests. The @Disabled annotation in JUnit5 is used to exclude the test methods from the test suite. This annotation can be applied over a test class as well as over individual test methods. This annotation accepts only one optional parameter where we can mention the reason … Continue reading How to disable tests in JUnit5 – @Disabled
How to Retry Test in JUnit5 – @RepeatedTest
HOME In JUnit5, JUnit Jupiter provides the ability to repeat a test a specified number of times by annotating a method with @RepeatedTest. We can specify the repetition frequency as a parameter to the @RepeatedTest annotation. When do we use the Repeated Test? Imagine, we are testing an online shopping website. In the process of … Continue reading How to Retry Test in JUnit5 – @RepeatedTest
How to run JUnit5 tests through Command Line
HOME The previous tutorial explains to configure Junit in IntelliJ and run the tests as JUnit Tests. This tutorial shows the steps to run the tests through command line. We can ask, why we need to run the tests through command line?? There are many reasons, one of the reason is to achieve CI/CD. To … Continue reading How to run JUnit5 tests through Command Line
AssertJ – Fluent Assertions in Java
HOME This tutorial describes the usage of the AssertJ – Fluent Assertions framework for writing tests in Java. Introduction to AssertJ The AssertJ project provides fluent assertion statements for test code written in Java. These assert statements are typically used with Java JUnit tests. AssertJ is composed of several modules: A core module to provide assertions for … Continue reading AssertJ – Fluent Assertions in Java
JUnit5 Assertions Example
HOME JUnit5 contains the assertions available as in JUnit 4 Assertions as well there are a few additional new asserts too. In this post, let’s discuss each new assertion in JUnit5 works in detail with examples. 1. assertIterableEquals The assertIterableEquals() asserts that the expected and the actual iterables are deeply equal. In order to be equal, both iterable … Continue reading JUnit5 Assertions Example
How to configure Junit in Intellij
HOME In this tutorial we will discuss to create a JUnit project using IntelliJ. We will be at first creating a simple Java Project and will add JUnit5 as well as create a Maven Project, then we will add a basic Class and a JUnit Test for it. Java Project Step 1 – Create a new Java Project. … Continue reading How to configure Junit in Intellij
Grouped Assertions in JUnit 5 – assertAll()
HOME What is JUnit5? JUnit 5 is composed of several different modules from three different sub-projects. JUnit 5 = JUnit Platform + JUnit Jupiter + JUnit Vintage The JUnit Platform serves as a foundation for launching testing frameworks on the JVM. It also defines the Test Engine API for developing a testing framework that runs on the platform. JUnit Jupiter is the combination of the … Continue reading Grouped Assertions in JUnit 5 – assertAll()
How to run Rest API Tests in GitLab CI/CD
HOME This tutorial explains the process to run the Rest API Tests in GitLab pipeline. This is a significant step towards achieving CI/CD. Ideally, the tests need to run after any change (minor/major) before merging the change to master branch. Suppose there are 100 changes in a day, and any QA won’t want to start … Continue reading How to run Rest API Tests in GitLab CI/CD
JUnit Tutorials
HOME JUnit is an open source Unit Testing Framework for JAVA.JUnit is a simple framework to write repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks. JUnit4 Chapter 1 How to configure Junit in Intellij Chapter 2 How to run JUnit5 tests through Command Line Chapter 3 JUnit4 Assertions Chapter … Continue reading JUnit Tutorials
Loading…
Something went wrong. Please refresh the page and/or try again.
Follow My Blog
Get new content delivered directly to your inbox.