JUNIT / NOTES</>↗JUnit17 Jul 2026
Generating test reports for JUnit tests helps you understand test results, track failures, analyze trends, and share results with your team or CI/CD pipeline. Here’s a comprehensive guide covering the most common approaches. 1. Using Maven Surefire Plugin (Default Reports) The Maven Surefire Plugin automatically generates test reports when you run tests. Basic Configuration <build> […]
JUNIT / NOTES</>↗JUnit17 Jul 2026
Running JUnit tests automatically in a CI/CD pipeline ensures every commit is verified before it reaches production. The core idea is simple: your CI server checks out the code, builds the project, and runs mvn test (or gradle test) — the same commands you use locally. Below are practical setups for the most common CI/CD […]
GRADLE / NOTES</>↗Gradle17 Jul 2026
Gradle has excellent built-in support for running JUnit tests. Configuring it properly ensures your tests are discovered, executed, and reported correctly. Let’s walk through the setup step by step. The Short Answer To run JUnit 5 (Jupiter) tests with Gradle, you need to: Add the JUnit Jupiter dependency to testImplementation. Enable the JUnit Platform in […]
JUNIT / NOTES</>↗JUnit13 Jul 2026
To configure Maven Surefire for running JUnit tests, add the Maven Surefire Plugin to the <build> section of your pom.xml. For modern JUnit 5 tests, you typically need: A JUnit 5 dependency The Maven Surefire Plugin Test classes named using Maven’s default test naming patterns 1. Add JUnit 5 Dependency <dependencies> <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter</artifactId> <version>5.13.4</version> […]
JUNIT / NOTES</>↗JUnit13 Jul 2026
If you are learning modern Java testing, the words JUnit Platform, JUnit Jupiter, and JUnit Vintage can be confusing at first. They sound like three different testing frameworks, but they are really three parts of the JUnit 5 ecosystem. The short version is: JUnit Platform runs tests. JUnit Jupiter is the modern JUnit 5 programming […]
JUNIT / NOTES</>↗JUnit13 Jul 2026
Testing Collections in JUnit In JUnit, you usually test collections with assertions such as: assertEquals assertTrue assertFalse assertIterableEquals assertArrayEquals assertThrows If you are using JUnit 5, import assertions from: import static org.junit.jupiter.api.Assertions.*; 1. Testing a List Use assertEquals when order matters. import org.junit.jupiter.api.Test; import java.util.List; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.j...