Class UpdateMockWebServer
- java.lang.Object
-
- org.openrewrite.Recipe
-
- org.openrewrite.java.testing.junit5.UpdateMockWebServer
-
public class UpdateMockWebServer extends org.openrewrite.RecipeRecipe for converting JUnit4 okhttp3 MockWebServer Rules with their JUnit5 equivalent. Note this recipe upgrades okhttp3 to version 4.x there are a few backwards incompatible changes: https://square.github.io/okhttp/upgrading_to_okhttp_4/#backwards-incompatible-changes - If MockWebServer Rule exists remove the Rule annotation and update okhttp3 to version 4.x - If AfterEach method exists insert a close statement for the MockWebServer and throws for IOException - If AfterEach does not exist then insert new afterEachTest method closing MockWebServer
-
-
Constructor Summary
Constructors Constructor Description UpdateMockWebServer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected @Nullable org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext>getApplicableTest()java.lang.StringgetDescription()java.lang.StringgetDisplayName()protected org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext>getVisitor()
-
-
-
Method Detail
-
getDisplayName
public java.lang.String getDisplayName()
- Specified by:
getDisplayNamein classorg.openrewrite.Recipe
-
getDescription
public java.lang.String getDescription()
- Overrides:
getDescriptionin classorg.openrewrite.Recipe
-
getApplicableTest
@Nullable protected @Nullable org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext> getApplicableTest()
- Overrides:
getApplicableTestin classorg.openrewrite.Recipe
-
getVisitor
protected org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext> getVisitor()
- Overrides:
getVisitorin classorg.openrewrite.Recipe
-
-