Package org.openrewrite.java.testing.junit5
@NullMarked
@NonNullFields
package org.openrewrite.java.testing.junit5
-
ClassesClassDescriptionIn Kotlin files, when both
import org.junit.jupiter.api.*and static imports fromorg.junit.jupiter.api.Assertionsare present, the Kotlin compiler cannot resolve which assertion method to use due to ambiguity between the Java static methods and the Kotlin extension functions.A recipe to replace JUnit 4's EnvironmentVariables rule from contrib with the JUnit 5-compatible `SystemStubsExtension` and `EnvironmentVariables` from the System Stubs library.Replace usages of JUnit 4's @Rule ExpectedException with JUnit 5 Assertions.A recipe that handles the usage of the junit-4 ExternalResourceRule's by adding the @ExtendWith(ExternalResourceSupport.class) annotation to the test class.Converts Pragmatists JUnitParamsRunner tests to their JUnit 5 ParameterizedTest and associated MethodSource equivalent ... Supports the following conversions `@Parameters` annotation without arguments and default `parametersFor...` init-method exists `@Parameters(method = "...")` annotation with defined method references `@Parameters(named = "...")` and associated `@NamedParameter` init-method Unsupported tests are identified with a comment on the associated `@Parameters(...)` annotation.Replaces JUnit 4 MockitoJUnit rules with JUnit MockitoExtension.Recipe for converting JUnit 4 okhttp3 MockWebServer Rules with their JUnit 5 equivalent.