How to pass a null value in JUnit 5 parameterized tests
How to pass a null for the below parameterized tests? @ParameterizedTest(name = "#{index} – Run test with args={0}") @ValueSource(strings = {"", " "}) // @ValueSource(strings = {"", " ", null}) // compile error void testBlankIncludeNull(String input) { assertTrue(StringUtils.isBlank(input)); } 1. Solution – @NullSource Since JUnit 5.4 and above, we can use the @NullSource to pass …