---
title: "#junit articles | Hashnode"
description: "Explore 88 articles tagged #junit on Hashnode. Tutorials, guides, and how-tos from the community."
url: "https://hashnode.com/tag/junit"
---

Tag

# #junit

88 posts · 27 followers

[BaoKhang](https://hashnode.com/@baokhang) · [6d ago](https://hashnode.com/posts/why-maven-build-cache-reruns-entire-test-suite/6af187a277c4a137b88f0cf4)

### [Why Maven Build Cache Still Re-Runs Your Entire Test Suite on One-Line Edits](https://baokhang.hashnode.dev/why-maven-build-cache-reruns-entire-test-suite?utm_source=hashnode&utm_medium=feed)

Build cache article: Maven caches per module, so one edited class re-runs every JUnit 5 test in it. Here is the measured effect and how to narrow it.

8 min read · [baokhang.hashnode.dev](https://baokhang.hashnode.dev/why-maven-build-cache-reruns-entire-test-suite?utm_source=hashnode&utm_medium=feed)

[Henry Brown](https://hashnode.com/@hbrown) · [Aug 20](https://hashnode.com/posts/keep-external-services-out-of-your-regular-build-with-junit-tags/6a874e2d2b460fb38a5c4b5c)

### [Stop External Services from Breaking Your Build with JUnit Tags](https://blog.hbrown.dev/keep-external-services-out-of-your-regular-build-with-junit-tags?utm_source=hashnode&utm_medium=feed)

Keep everyday tests fast and dependable while running strict live integration tests only when you choose

11 min read · [blog.hbrown.dev](https://blog.hbrown.dev/keep-external-services-out-of-your-regular-build-with-junit-tags?utm_source=hashnode&utm_medium=feed)

[Leo D. Penrose](https://hashnode.com/@ldpenrose) · [Jan 24](https://hashnode.com/posts/the-day-a-unit-test-saved-my-bookcase-from-being-shelf-less/69753bfd1c55b7a8f4ef3b26)

### [The Day a Unit Test Saved My Bookcase From Being Shelf-less](https://buildingbibby.hashnode.dev/the-day-a-unit-test-saved-my-bookcase-from-being-shelf-less?utm_source=hashnode&utm_medium=feed)

I used to think unit tests were one of those “nice in theory” things. Like flossing, or reading documentation before coding. Then I wrote a unit test in Bibby and it immediately caught a real bug — the kind of bug that would’ve quietly lived in produ...

5 min read · [buildingbibby.hashnode.dev](https://buildingbibby.hashnode.dev/the-day-a-unit-test-saved-my-bookcase-from-being-shelf-less?utm_source=hashnode&utm_medium=feed)

[Ajit Marathe](https://hashnode.com/@automationwithajit) · [Jan 20](https://hashnode.com/posts/cucumber-with-junit-complete-execution-guide-ide-maven/696fa44d9d3b26578e242903)

### [Cucumber with JUnit: Complete Execution Guide (IDE + Maven)](https://automationwithajit.hashnode.dev/cucumber-with-junit-complete-execution-guide-ide-maven?utm_source=hashnode&utm_medium=feed)

Introduction Cucumber is one of the most widely used BDD (Behavior Driven Development) tools in test automation.In real-world projects, Cucumber is commonly integrated with JUnit, especially in Java-based automation frameworks. This article explain...

4 min read · [automationwithajit.hashnode.dev](https://automationwithajit.hashnode.dev/cucumber-with-junit-complete-execution-guide-ide-maven?utm_source=hashnode&utm_medium=feed)

[Ganesh Rama Hegde](https://hashnode.com/@hegde10122) · [Nov 12, 2025](https://hashnode.com/posts/chapter-31-imagesearchscreen-composable-testing-final-code/6914fe70e1ffda5f6ea6d8d8)

### [Chapter 31 : ImageSearchScreen Composable Testing (Final Code)](https://androidavatar.hashnode.dev/chapter-31-imagesearchscreen-composable-testing-final-code?utm_source=hashnode&utm_medium=feed)

package androidavatar.learning.artlearnersapp.presentation.ui import androidx.compose.ui.test.\* import androidx.compose.ui.test.junit4.createComposeRule import org.junit.Rule import org.junit.Test class ImageSearchScreenTest { @get:Rule va...

3 min read · [androidavatar.hashnode.dev](https://androidavatar.hashnode.dev/chapter-31-imagesearchscreen-composable-testing-final-code?utm_source=hashnode&utm_medium=feed)

[Ganesh Rama Hegde](https://hashnode.com/@hegde10122) · [Nov 1, 2025](https://hashnode.com/posts/chapter-11-testing-the-artviewmodel/6905f8dacaed4c6cbcbfe450)

### [Chapter 11 - Testing the ArtViewModel](https://androidavatar.hashnode.dev/chapter-11-testing-the-artviewmodel?utm_source=hashnode&utm_medium=feed)

Now we will code the class ArtViewModelTest, which validates that the ArtViewModel in chapter 10 correctly collects and exposes data from the domain layer (via the GetArtUseCase). package com.learning.artsnapapp.presentation.viewmodel import app.cas...

3 min read · [androidavatar.hashnode.dev](https://androidavatar.hashnode.dev/chapter-11-testing-the-artviewmodel?utm_source=hashnode&utm_medium=feed)

[Ganesh Rama Hegde](https://hashnode.com/@hegde10122) · [Oct 30, 2025](https://hashnode.com/posts/chapter-8-testing-and-validating-the-getartusecase-domain-layer/6903c6a571310108347aa683)

### [Chapter 8 - Testing and Validating the GetArtUseCase (Domain layer)](https://androidavatar.hashnode.dev/chapter-8-testing-and-validating-the-getartusecase-domain-layer?utm_source=hashnode&utm_medium=feed)

Now we shift our attention to testing the domain and the data layers for the GetArtUseCase. Step 1 : Testing the Domain Layer We want to verify that GetArtUseCase correctly transmits data from the repository. We only test the use case, not the databa...

3 min read · [androidavatar.hashnode.dev](https://androidavatar.hashnode.dev/chapter-8-testing-and-validating-the-getartusecase-domain-layer?utm_source=hashnode&utm_medium=feed)

[Nipuna Upeksha](https://hashnode.com/@nipunaupeksha) · [Sep 30, 2025](https://hashnode.com/posts/spring-mockmvc-test-with-mockito-and-junit/68dc39f1846ca4b9102c651c)

### [Spring MockMVC Test with Mockito and JUnit 🧪](https://nipunaupeksha.hashnode.dev/spring-mockmvc-test-with-mockito-and-junit?utm_source=hashnode&utm_medium=feed)

🧬 Introduction When building REST APIs with Spring, ensuring that our endpoints behave correctly is just as important as implementing them. Writing tests allows us to verify functionality, prevent regressions, and maintain confidence as our applicat...

4 min read · [nipunaupeksha.hashnode.dev](https://nipunaupeksha.hashnode.dev/spring-mockmvc-test-with-mockito-and-junit?utm_source=hashnode&utm_medium=feed)

[Nipuna Upeksha](https://hashnode.com/@nipunaupeksha) · [Sep 27, 2025](https://hashnode.com/posts/java-testing-frameworks-junit/68d83f37982516a51745b8d0)

### [Java Testing Frameworks - JUnit 🧪](https://nipunaupeksha.hashnode.dev/java-testing-frameworks-junit?utm_source=hashnode&utm_medium=feed)

👾 Introduction Testing is one of the most important aspects when building applications. Java has multiple testing frameworks which help to test different functionalities. But first, we need to have a good idea of why we are writing tests. 🧪 Why Tes...

28 min read · [nipunaupeksha.hashnode.dev](https://nipunaupeksha.hashnode.dev/java-testing-frameworks-junit?utm_source=hashnode&utm_medium=feed)

[Ada Cheng](https://hashnode.com/@adafycheng) · [Sep 4, 2025](https://hashnode.com/posts/configure-environment-variables-in-junit-tests/68b966b68cbfb282fc58f282)

### [Configure Environment Variables in JUnit Tests](https://blog.adafycheng.dev/configure-environment-variables-in-junit-tests?utm_source=hashnode&utm_medium=feed)

In this article, we'll write a JUnit Test configured with Environment Variables using junit-pioneer library. First of all, we need to add the junit-pioneer library and maven-surefire-plugin to the Maven pom.xml. <project> <properties> <p...

1 min read · [blog.adafycheng.dev](https://blog.adafycheng.dev/configure-environment-variables-in-junit-tests?utm_source=hashnode&utm_medium=feed)
