Skip to content

Tag: junit5

junit 5 custom parametrized tests

I’m using Junit 5 parametrized tests with custom name as follow where PARAMETERIZED_TESTS_NAME_PLACEHOLDER is defined in its own utility class the problem I’m facing is that as I’m using extensively the parametrized tests, my code is cluttered by these @ParameterizedTest(name = PARAMETERIZED…

JUnit5: Specify order of execution of multiple @Nested classes

Does Junit5 give any guarantees regarding execution order of @Nested classes defined within the same parent? With a trivial example I made, I notice the tests are executed in reverse order of declaration, but this behavior is neither documented (or is it?) nor consistent with how @Test annotated methods are o…

How to get rid of TemporaryFolder rule in Junit5

I’m migrating unit tests from Junit4 to Junit5. In the test I’m using TemporaryFolder rule from Junit4 API. To keep the test working I added @EnableRuleMigrationSupport annotation: As I understand, in Junit5 I need to use extensions instead of rules, but I can’t find any replacement for Temp…