Skip to content

Proposed code changes to us template#853

Merged
steve-aom-elliott merged 1 commit into1589-correcting-mockwebserver-migrationfrom
1589-correcting-mockwebserver-migration-template
Nov 27, 2025
Merged

Proposed code changes to us template#853
steve-aom-elliott merged 1 commit into1589-correcting-mockwebserver-migrationfrom
1589-correcting-mockwebserver-migration-template

Conversation

@Jenson3210
Copy link
Copy Markdown
Contributor

No description provided.

@Jenson3210 Jenson3210 self-assigned this Nov 26, 2025
@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite Nov 26, 2025
@steve-aom-elliott steve-aom-elliott merged commit 94fd580 into 1589-correcting-mockwebserver-migration Nov 27, 2025
@steve-aom-elliott steve-aom-elliott deleted the 1589-correcting-mockwebserver-migration-template branch November 27, 2025 21:33
@github-project-automation github-project-automation bot moved this from In Progress to Done in OpenRewrite Nov 27, 2025
steve-aom-elliott pushed a commit that referenced this pull request Dec 11, 2025
steve-aom-elliott pushed a commit that referenced this pull request Dec 12, 2025
steve-aom-elliott pushed a commit that referenced this pull request Jan 7, 2026
dsgrieve pushed a commit that referenced this pull request Jan 15, 2026
timtebeek added a commit that referenced this pull request Jan 22, 2026
* WiP

* WiP 2 - am able to get `.build()` added, but seems to drop the after padding (including the newline), leading to it changing wrapping.

* Expanding tests and conversions to include headers methods

* Adapted the failing recipe to add as much debug/retry information as possible for future error occurrences. (#853)

* Reapplying paddings from arguments as they were prior to chaining `.build()`, and backpatching the parameter types onto the various method invocations. Feels like there could be a lot of improvement still with how this done, as it feels pretty hacky right now.

* wip

* WiP - Ripped out a lot

* wip classpath jars

* iterate over a list of old to new replacement methods

* use template for adding .build() on MockResponseBuilder

* try to handle chained call

* inline static patchReturnTypeAndName method call

* Apply suggestions from code review

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update src/test/java/org/openrewrite/java/testing/junit5/UpgradeOkHttpMockWebServerTest.java

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update src/main/java/org/openrewrite/java/testing/junit5/UpdateMockWebServerMockResponse.java

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* patch .build() return type and name

* replace edits lost in merge

* update recipes.csv

* add test for method name changes and test with MockResponse return type

* fix unit tests

* clean up

* convert MockResponse "with" methods

* fix line wrap

* Use separate test classes for the two cases

* Remove unused field

* remove duplicate code in patchReturnTypeAndName

* Inline the delegating `patchReturnTypeAndName`

* Replace the ChangePackage with a call to UpdateMockWebServerMockResponse

* Use `ChangeMethodName` instead of `MethodInvocationReplacement`

* Inline the `patchReturnTypeAndName` used once

* Move existing recipes into `getRecipeList()`

* Move replacements down to only usage

* Change `methodInvocationsToAdjust` to local field

* Drop unnecessary list of indices

* Always carry over prefix from arg

* Simplify `patchBuilderBuildReturnTypeAndName`

* Use inlined `JavaType.ShallowClass.build`

* Inline `patchBuilderBuildReturnTypeAndName`

* Final touches

* Change return type before renaming method; add missing imports

---------

Co-authored-by: Jente Sondervorst <jentesondervorst@gmail.com>
Co-authored-by: David Grieve <david@moderne.io>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Tim te Beek <tim@moderne.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants