Class UpdateMockWebServer
java.lang.Object
org.openrewrite.Recipe
org.openrewrite.java.testing.junit5.UpdateMockWebServer
- All Implemented Interfaces:
Cloneable
public class UpdateMockWebServer
extends org.openrewrite.Recipe
Recipe for converting JUnit 4 okhttp3 MockWebServer Rules with their JUnit 5 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
-
Field Summary
Fields inherited from class org.openrewrite.Recipe
contributors, examples, PANIC -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<org.openrewrite.Recipe>org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext> Methods inherited from class org.openrewrite.Recipe
addDataTable, causesAnotherCycle, clone, createRecipeDescriptor, equals, getContributors, getDataTableDescriptors, getDescriptor, getEstimatedEffortPerOccurrence, getExamples, getJacksonPolymorphicTypeTag, getMaintainers, getName, getTags, hashCode, maxCycles, noop, run, run, run, setContributors, setExamples, validate, validate, validateAll
-
Constructor Details
-
UpdateMockWebServer
public UpdateMockWebServer()
-
-
Method Details
-
getDisplayName
- Specified by:
getDisplayNamein classorg.openrewrite.Recipe
-
getDescription
- Specified by:
getDescriptionin classorg.openrewrite.Recipe
-
getVisitor
public org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext> getVisitor()- Overrides:
getVisitorin classorg.openrewrite.Recipe
-
getRecipeList
- Overrides:
getRecipeListin classorg.openrewrite.Recipe
-