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</>↗
JUnit08 Jul 2026

How do I understand test naming conventions in JUnit?

JUnit itself does not require one specific naming convention for test methods, especially in JUnit 5. A test method is recognized because it is annotated with @Test, not because of its name. That said, good test names are crucial because they explain what behavior is being tested. 1. Test Class Naming A common convention is […]

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

How do I test exceptions with assertThrows()?

Testing Exceptions with assertThrows() in JUnit 5 Use assertThrows() when you expect a piece of code to throw a specific exception. Basic Syntax ExceptionType exception = assertThrows( ExceptionType.class, () -> { // code that should throw the exception } ); For JUnit 5, import it like this: import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertThrows; Simple Example import […]

Wayan · 3 min read
JUNIT / NOTES</>↗
JUnit08 Jul 2026

How do I group multiple assertions with assertAll()?

In JUnit 5, you can group multiple assertions using assertAll(). This lets JUnit run all assertions in the group, even if one fails, and then report all failures together. Basic Syntax import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*; class UserTest { @Test void testUserDetails() { User user = new User("Alice", 25, "alice@example.com"); assertAll("User details", () -> assertEquals("Alice", […]

Wayan · 3 min read
JUNIT / NOTES</>↗
JUnit08 Jul 2026

How do I test null and non-null values in JUnit?

To test null and non-null values in JUnit, use these assertions: assertNull(value) — passes if the value is null assertNotNull(value) — passes if the value is not null In JUnit 5, these methods are available from org.junit.jupiter.api.Assertions. Basic Example import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertNotNull; class NullCheckTest { @Test void valueShouldBeNull() { String [...

Wayan · 3 min read
JUNIT / NOTES</>↗
JUnit08 Jul 2026

How do I test boolean conditions with assertTrue() and assertFalse()?

Use assertTrue() when you expect a boolean condition to be true, and assertFalse() when you expect it to be false. They are JUnit assertions, most commonly used in JUnit 5 like this: import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; class BooleanConditionTest { @Test void shouldCheckBooleanConditions() { String message = "Hello JUnit"; assertTrue(message.contains("JUnit"));...

Wayan · 2 min read
JUNIT / NOTES</>↗
JUnit08 Jul 2026

How do I test expected values with assertEquals()?

In JUnit, you use assertEquals() to test whether an actual value matches an expected value. The basic syntax is: assertEquals(expectedValue, actualValue); The first argument is what you expect. The second argument is what your code actually produced. Basic Example import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; class CalculatorTest { @Test void shouldAddTwoNumbers() { int result = 2 […]

Wayan · 2 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.