Upgrade to Pro — share decks privately, control downloads, hide ads and more …

JUnit 6.0

JUnit 6.0

Thanks to the Sovereign Tech Fund I had the opportunity to work full-time on JUnit in 2025 and 2026. In this lightning talk, I will talk about my experience and will shortly introduce new features and improvements. Among them are Open Test Reporting, parameterized test classes, and discovery issues.

Avatar for Marc Philipp

Marc Philipp

October 16, 2025
Tweet

More Decks by Marc Philipp

Other Decks in Programming

Transcript

  1. Open Test Reporting XML format • • junit-platform- reporting •

    junit.platform.reporting.open.xml.enabled=true 11
  2. Parameterized Test Methods • @ParameterizedTest • @���Source class SomeTests {

    @ParameterizedTest @ValueSource(strings = {"foo", "bar"}) void shouldNotBeNull(String value) { assertNotNull(value); } @ParameterizedTest @ValueSource(strings = {"foo", "bar"}) void lengthShouldBeThree() { assertEquals(3, value.length()); } } 17
  3. Parameterized Test Classes • @ParameterizedClass • @���Source @ParameterizedClass @ValueSource(strings =

    {"foo", "bar"}) class SomeTests { @Parameter String value; @Test void shouldNotBeNull() { assertNotNull(value); } @Test void lengthShouldBeThree() { assertEquals(3, value.length()); } } 18
  4. Consuming Arguments • • @ParameterizedClass @ValueSource(strings = {"foo", "bar"}) record

    SomeTests(String value) { @Test void shouldNotBeNull() { assertNotNull(value); } @Test void lengthShouldBeThree() { assertEquals(3, value.length()); } } 19
  5. Valid test methods? @Test �� Java int test() { return

    42; } @Test �� Kotlin fun test(): Nothing = fail() 22
  6. Valid test methods? @Test �� Java int test() { return

    42; } @Test �� Kotlin fun test(): Nothing = fail() @Test void Unit 22.1