Ruang penulis
SEBUAH JURNAL TENTANG TEKNOLOGI

Belajar hal baru.
Tulis. Bagikan.

Ruang untuk merangkai pengetahuan, satu baris kode setiap hari.
Temukan tutorial, ide, dan catatan dari perjalanan belajar.

1914 catatan & terus bertumbuh
PILIHAN EDITOR
Java

Memahami Java Stream: olah koleksi dengan lebih ringkas

Pelajari alur filter, map, dan collect untuk mengolah data Java dengan kode yang mudah dibaca.

D Tim Diary Coding · 1 menit baca
UNTUK RASA INGIN TAHUMU

Catatan terbaru.

JUNIT / CATATAN</>
JUnit10 Jul 2026

How do I organize tests with nested test classes?

Organizing Tests with Nested Test Classes Nested test classes are a great way to group related tests inside a single test class. In Java, this is commonly done with JUnit 5 using @Nested. They help you structure tests around: A specific method A scenario A state of the object under test Success vs failure cases […]

Wayan · 4 menit baca
JUNIT / CATATAN</>
JUnit10 Jul 2026

How do I add display names to JUnit tests?

In JUnit 5, you can add readable names to your tests using the @DisplayName annotation. @DisplayName lets you show a friendly, human-readable test name in test reports and IDE test runners instead of relying only on the Java method name. Example import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; class CalculatorTest { @Test @DisplayName("Adding two positive […]

Wayan · 3 menit baca
JUNIT / CATATAN</>
JUnit10 Jul 2026

How do I disable a test with @Disabled annotation?

In JUnit 5, you can disable a test by annotating it with @Disabled from the org.junit.jupiter.api package. Disable a Single Test Method import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; class CalculatorTest { @Test @Disabled void divisionByZeroTest() { // This test will be skipped } } When you run the test suite, this test will not be executed. Add […]

Wayan · 2 menit baca
JUNIT / CATATAN</>
JUnit09 Jul 2026

How do I understand the JUnit test lifecycle?

The JUnit test lifecycle describes the order in which JUnit creates test objects, runs setup code, executes test methods, and performs cleanup. Understanding this lifecycle helps you write tests that are clean, predictable, and easy to maintain. This guide focuses on JUnit 5, also known as JUnit Jupiter. 1. What Is the JUnit Test Lifecycle? […]

Wayan · 8 menit baca
JUNIT / CATATAN</>
JUnit09 Jul 2026

How do I use @BeforeAll and @AfterAll in JUnit?

In JUnit 5, @BeforeAll and @AfterAll are lifecycle annotations used to run setup and cleanup code once per test class. They are useful when you need to initialize or clean up expensive shared resources, such as: database connections test containers temporary directories mock servers shared test data application-wide configuration Basic Rule By default, methods annotated […]

Wayan · 4 menit baca
JUNIT / CATATAN</>
JUnit09 Jul 2026

How do I use @BeforeEach and @AfterEach in JUnit?

In JUnit 5, @BeforeEach and @AfterEach are lifecycle annotations. They let you run code before and after every test method. Annotation When it runs Common use @BeforeEach Before each @Test method Create objects, initialize test data, reset state @AfterEach After each @Test method Clean up resources, close files/connections, reset temporary state Basic Example import org.junit.jupiter.api.AfterEach; […]

Wayan · 4 menit baca

Pengetahuan tumbuh ketika dibagikan.

Simpan rasa ingin tahu. Selalu ada hal baru untuk dipelajari.

Jelajahi catatan ↗
Putu Adi Guna Permana
TENTANG PENULIS

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

Penulis dan pendiri Diary Coding — berbagi catatan, tutorial, dan pengalaman seputar pemrograman untuk siapa pun yang ingin terus belajar.