JUNIT / CATATAN</>↗JUnit17 Jul 2026
JUnit 5 provides a powerful extension model that lets you hook into the test lifecycle. Here’s a comprehensive guide to creating custom extensions. 1. Choose the Right Extension Interface JUnit 5 offers several extension interfaces depending on what you want to do: Interface Purpose BeforeAllCallback / AfterAllCallback Run code before/after all tests in a class […]
JUNIT / CATATAN</>↗JUnit17 Jul 2026
JUnit Jupiter (JUnit 5) provides a powerful extension model that lets you plug custom behavior into the test lifecycle. Instead of the old JUnit 4 approach of using @RunWith (which allowed only one runner) or @Rule, JUnit 5 uses @ExtendWith — and you can apply as many extensions as you want. Let’s break this down […]
JUNIT / CATATAN</>↗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 / CATATAN</>↗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 / CATATAN</>↗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 / CATATAN</>↗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> […]