Slide 1

Slide 1 text

Catching up with JUnit 5.12, 5.13, and beyond 1

Slide 2

Slide 2 text

Marc Philipp 2

Slide 3

Slide 3 text

JUnit in a nutshell • • • • • 3

Slide 4

Slide 4 text

Thank you to our sponsors! 4

Slide 5

Slide 5 text

The Sovereign Tech Fund is investing in JUnit in 2024 and 2025! 5

Slide 6

Slide 6 text

Sovereign Tech Fund • • 6

Slide 7

Slide 7 text

JUnit Generations 7

Slide 8

Slide 8 text

JUnit Generations 7.1

Slide 9

Slide 9 text

JUnit Generations 7.2

Slide 10

Slide 10 text

JUnit Generations 7.3

Slide 11

Slide 11 text

Full-time work on JUnit (2024-2025) 8

Slide 12

Slide 12 text

Full-time work on JUnit (2024-2025) • 8.1

Slide 13

Slide 13 text

Full-time work on JUnit (2024-2025) • • 8.2

Slide 14

Slide 14 text

Full-time work on JUnit (2024-2025) • • • 8.3

Slide 15

Slide 15 text

Full-time work on JUnit (2024-2025) • • • • 8.4

Slide 16

Slide 16 text

Full-time work on JUnit (2024-2025) • • • • • 8.5

Slide 17

Slide 17 text

Full-time work on JUnit (2024-2025) • • • • • • 8.6

Slide 18

Slide 18 text

Full-time work on JUnit (2024-2025) • • • • • • • 8.7

Slide 19

Slide 19 text

Full-time work on JUnit (2024-2025) • • • • • • • • 8.8

Slide 20

Slide 20 text

Full-time work on JUnit (2024-2025) • • • • • • • • 8.9

Slide 21

Slide 21 text

Today’s Agenda 9

Slide 22

Slide 22 text

Better Test Reports 10

Slide 23

Slide 23 text

Open Test Reporting XML format • • junit-platform- reporting • junit.platform.reporting.open.xml.enabled=true 11

Slide 24

Slide 24 text

Event-based format ��result>��e:finished ��result>��e:finished ��result>��e:finished ��result>��e:finished ��e:events> 12

Slide 25

Slide 25 text

Hierarchical format [engine:junit-jupiter]��junit:uniqueId> JUnit Jupiter��junit:legacyReportingName> CONTAINER��junit:type> ��metadata> ���� ��� �����metadata> ���� ��� �����metadata> ���� ��� �����metadata> ��h:child> 13

Slide 26

Slide 26 text

HTML Report • ▪ • 14

Slide 27

Slide 27 text

Demo 15

Slide 28

Slide 28 text

Platform-agnostic and extensible • • 16

Slide 29

Slide 29 text

Future work • • • 17

Slide 30

Slide 30 text

Parameterized Test Classes 18

Slide 31

Slide 31 text

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()); } } 19

Slide 32

Slide 32 text

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()); } } 20

Slide 33

Slide 33 text

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

Slide 34

Slide 34 text

Demo 22

Slide 35

Slide 35 text

Mutable vs. immutable arguments • @ParameterizedClass • • @AfterEach 23

Slide 36

Slide 36 text

Argument Source Annotations • @ValueSource @EnumSource @NullSource @EmptySource • @CsvSource @CsvFileSource • @MethodSource @FieldSource • @ArgumentsSource(MyProvider.class) 24

Slide 37

Slide 37 text

Lifecycle Methods (Recap) • @BeforeParameterizedClassInvocation @AfterParameterizedClassInvocation • 25

Slide 38

Slide 38 text

Discovery Issues 26

Slide 39

Slide 39 text

Discovery issues? 27

Slide 40

Slide 40 text

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

Slide 41

Slide 41 text

Valid test methods? @Test �� Java int test() { return 42; } @Test �� Kotlin fun test(): Nothing = fail() @Test void Unit 28.1

Slide 42

Slide 42 text

Malformed declarations • • • 29

Slide 43

Slide 43 text

Discovery issue reporting • • • • junit.platform.discovery.issue.severity.critical 30

Slide 44

Slide 44 text

Demo 31

Slide 45

Slide 45 text

Roadmap for 6.0 32

Slide 46

Slide 46 text

Overview of 6.0 • ▪ ▪ • 33

Slide 47

Slide 47 text

Major changes in 6.0 34

Slide 48

Slide 48 text

Major changes in 6.0 • 34.1

Slide 49

Slide 49 text

Major changes in 6.0 • • 34.2

Slide 50

Slide 50 text

Major changes in 6.0 • • • @Nullable 34.3

Slide 51

Slide 51 text

Major changes in 6.0 • • • @Nullable • 34.4

Slide 52

Slide 52 text

Major changes in 6.0 • • • @Nullable • ▪ 34.5

Slide 53

Slide 53 text

Major changes in 6.0 • • • @Nullable • ▪ • 34.6

Slide 54

Slide 54 text

Long(er)-Term Support for 5.13.x • • 35

Slide 55

Slide 55 text

Timeline for 6.0 36

Slide 56

Slide 56 text

Timeline for 6.0 36.1

Slide 57

Slide 57 text

Timeline for 6.0 ⋮ 36.2

Slide 58

Slide 58 text

Timeline for 6.0 ⋮ ⋮ 36.3

Slide 59

Slide 59 text

Spring Framework 7.0 will be based on JUnit 6.0 37

Slide 60

Slide 60 text

We need your help! 38

Slide 61

Slide 61 text

Did I mention we need a new logo? 39

Slide 62

Slide 62 text

Example Code and Slides • • 40

Slide 63

Slide 63 text

Q & A 41

Slide 64

Slide 64 text

Thanks! 42