Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt new MockWebServer Maven coordinate and package name #3

Open
timtebeek opened this issue Jul 23, 2023 · 0 comments
Open

Adopt new MockWebServer Maven coordinate and package name #3

timtebeek opened this issue Jul 23, 2023 · 0 comments
Labels
good first issue Good for newcomers recipe

Comments

@timtebeek
Copy link
Contributor

What problem are you trying to solve?

Version 5.0.0-alpha.2 changes the MockWebServer Maven coordinate and package name.

In this release MockWebServer has a new Maven coordinate and package name. A longstanding problem with MockWebServer has been its API dependency on JUnit 4. We’ve reorganized things to remove that dependency while preserving backwards compatibility.

Maven Coordinate Package Name Description
com.squareup.okhttp3:mockwebserver3:5.0.0-alpha.2 mockwebserver3 Core module. No JUnit dependency!
com.squareup.okhttp3:mockwebserver3-junit4:5.0.0-alpha.2 mockwebserver3.junit4 Optional JUnit 4 integration.
com.squareup.okhttp3:mockwebserver3-junit5:5.0.0-alpha.2 mockwebserver3.junit5 Optional JUnit 5 integration.
com.squareup.okhttp3:mockwebserver:5.0.0-alpha.2 okhttp3.mockwebserver Obsolete. Depends on JUnit 4.

What precondition(s) should be checked before applying this recipe?

None.

Describe the situation before applying the recipe

Old dependency & package in use.

Describe the situation after applying the recipe

Dependency & package updated.

Have you considered any alternatives or workarounds?

Not really

Any additional context

Source: https://square.github.io/okhttp/changelogs/changelog/#version-500-alpha2

For the implementation we could likely reuse these existing recipes configured through Yaml:
https://docs.openrewrite.org/recipes/java/changepackage
https://docs.openrewrite.org/recipes/java/dependencies/changedependency

That way at most we'll need some tests if we want to be sure we correctly replace these, but no code otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers recipe
Projects
Status: Recipes Wanted
Development

No branches or pull requests

1 participant