SupportWriter space ↗
A JOURNAL ABOUT TECHNOLOGY

Learn something new.
Write. Share.

A space to connect knowledge, one line of code a day.
Discover tutorials, ideas, and notes from a learning journey.

1967 notes & counting ↙
EDITOR’S PICK ↗
Pentesting

Planning Your First Web Application Pentest: Scope, Safety, and Evidence

Build a focused web pentest plan with clear authorization, realistic objectives, controlled testing, and evidence that developers can use.

D Putu Adi Guna Permana · 3 min read
FOR YOUR CURIOSITY

Latest notes.

JUNIT / NOTES</>↗
JUnit13 Jul 2026

How do I write tests for utility classes?

Utility classes are usually tested like any other unit: test their public behavior, especially calculations, transformations, validation rules, edge cases, and error handling. The main difference is that utility classes often have static methods, so your tests usually call the method directly instead of creating an object. 1. Test Useful Behavior, Not the Fact That […]

Wayan · 7 min read
JUNIT / NOTES</>↗
JUnit12 Jul 2026

How do I structure unit tests in a real Java project?

In a real Java project, unit tests should be organized so they are easy to find, run, understand, and maintain. A good structure follows the same shape as your production code and keeps tests focused on behavior. Most Java projects use this standard layout: project-root ├── src │ ├── main │ │ └── java │ […]

Wayan · 12 min read
JUNIT / NOTES</>↗
JUnit12 Jul 2026

How do I test private logic without testing private methods directly?

The best way to test private logic is to test the observable behavior that depends on it, usually through the class’s public methods. Private methods are implementation details. If you test them directly, your tests become tightly coupled to how the class is written internally. That makes refactoring harder because changing a private method can […]

Wayan · 6 min read
JUNIT / NOTES</>↗
JUnit12 Jul 2026

How do I test code that depends on time?

Code that depends directly on the current date or time can be difficult to test because the result changes every time the test runs. For example, code like this is hard to test reliably: import java.time.LocalDate; public class SubscriptionService { public boolean isExpired(LocalDate expiryDate) { return expiryDate.isBefore(LocalDate.now()); } } The problem is LocalDate.now(). Today’s test […]

Wayan · 6 min read
JUNIT / NOTES</>↗
JUnit12 Jul 2026

How do I use assumptions in JUnit tests?

In JUnit 5, assumptions let you run a test only when certain conditions are true. If an assumption fails, the test is skipped/aborted, not failed. They are useful when a test depends on things like: operating system environment variables external services database availability specific Java version local developer setup JUnit assumptions are available from: import […]

Wayan · 4 min read
JUNIT / NOTES</>↗
JUnit12 Jul 2026

How do I write repeated tests in JUnit?

In JUnit 5, repeated tests are written using the @RepeatedTest annotation. A repeated test runs the same test method multiple times without requiring different input values. Basic Example import org.junit.jupiter.api.RepeatedTest; import static org.junit.jupiter.api.Assertions.assertTrue; class RandomNumberTest { @RepeatedTest(5) void randomNumberShouldBeLessThanTen() { int number = (int) (Math.random() * 10); assertTrue(number >= 0 && number < 10); } […]

Wayan · 3 min read
✳

Knowledge grows when shared.

Stay curious. There is always something new to learn.

Explore notes ↗
Putu Adi Guna Permana
ABOUT THE AUTHOR

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Writer and founder of Diary Coding — sharing notes, tutorials, and experiences about programming for anyone who wants to keep learning.