Tagged articles

JUnit5

10 articles · Page 1 of 1
The Dominant Programmer
The Dominant Programmer
Jun 6, 2026 · Backend Development

Mockito Unit Testing: A Complete Guide to Testing Java Service Layers

This article explains unit testing fundamentals, compares unit and integration tests, introduces Mockito's core annotations and APIs, walks through a full order‑resend example with detailed test cases, and covers best‑practice methodologies, advanced techniques, common pitfalls, naming conventions, and how to run the tests.

Given-When-ThenJUnit5Java
0 likes · 21 min read
Mockito Unit Testing: A Complete Guide to Testing Java Service Layers
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Jun 2, 2026 · Backend Development

Simplify Resource Cleanup in JUnit with the New @AutoClose Annotation

The article introduces JUnit's @AutoClose annotation (added in version 5.11), compares the traditional @BeforeEach/@AfterEach cleanup pattern with the annotation's automatic resource closing, and demonstrates its use across file I/O, database connections, HTTP clients, streams, and custom AutoCloseable classes, including warning behavior for null fields.

@AutoCloseJUnitJUnit5
0 likes · 8 min read
Simplify Resource Cleanup in JUnit with the New @AutoClose Annotation
Java Tech Workshop
Java Tech Workshop
Apr 8, 2026 · Backend Development

SpringBoot Integration Testing: Using @SpringBootTest with MockMvc

SpringBoot integration tests load the full application context to verify end‑to‑end behavior, while unit tests only cover isolated methods; this guide explains @SpringBootTest fundamentals, configuration options, MockMvc usage, test structure, common pitfalls, and best practices for reliable full‑stack testing.

Integration TestingJUnit5MockMvc
0 likes · 26 min read
SpringBoot Integration Testing: Using @SpringBootTest with MockMvc
Huolala Tech
Huolala Tech
Nov 16, 2023 · Fundamentals

Why Unit Testing Matters and How to Master It in Java Projects

This article explains what unit testing is, why it is essential for software quality, outlines its benefits such as early bug detection and design improvement, and provides practical guidance on writing effective Java unit tests using JUnit5, Mockito, and JaCoCo, along with CI integration and best‑practice principles.

CI/CDJUnit5JaCoCo
0 likes · 28 min read
Why Unit Testing Matters and How to Master It in Java Projects
Alibaba Cloud Developer
Alibaba Cloud Developer
Feb 14, 2022 · Backend Development

Boost Java Unit Testing with JUnit5, Mockito, and Auto‑Generated Code

This article examines common unit‑testing problems in Java projects, analyzes their root causes such as development and maintenance costs, and presents practical solutions including choosing JUnit5, leveraging Mockito, using in‑memory databases, and employing a custom IntelliJ plugin to automatically generate test code and test data.

JUnit5JavaMockito
0 likes · 18 min read
Boost Java Unit Testing with JUnit5, Mockito, and Auto‑Generated Code
Programmer DD
Programmer DD
Sep 6, 2021 · Fundamentals

Master JUnit5: Why Upgrade from JUnit4 and How to Use Its Powerful Features

This article explains why developers should switch from JUnit4 to JUnit5, outlines the JUnit5 architecture, shows how to add the proper Maven dependency, and provides practical examples of common annotations, assertions, repeated, parameterized, and nested tests for Spring Boot projects.

JUnit5JavaSpring Boot
0 likes · 7 min read
Master JUnit5: Why Upgrade from JUnit4 and How to Use Its Powerful Features
FunTester
FunTester
Feb 10, 2020 · Backend Development

Migrating to Spock 2.0 M1 with JUnit 5 – Gradle & Maven Setup Guide

This article explains the major changes in Spock 2.0 M1, how to integrate it with JUnit 5 via the JUnit Platform, provides step‑by‑step Gradle and Maven configurations, discusses compatibility issues with Groovy versions, and offers solutions for JUnit 4 Rule migration.

JUnit5Java TestingSpock
0 likes · 6 min read
Migrating to Spock 2.0 M1 with JUnit 5 – Gradle & Maven Setup Guide
FunTester
FunTester
Jan 14, 2020 · Fundamentals

Master Selenium PageFactory: Build Robust Page Objects for Test Automation

This tutorial explains how to use Selenium's built‑in PageFactory to implement the Page Object pattern, defines a TodoMVC API, provides JUnit 5 test examples, shows a concrete Page implementation with @FindBy annotations, discusses additional locator annotations, element lookup timing, and demonstrates running the tests from the command line.

JUnit5JavaPage Object
0 likes · 11 min read
Master Selenium PageFactory: Build Robust Page Objects for Test Automation