OkHttp MockWebServer MockResponse to 5.x MockWebServer3 MockResponse

MSAL

Replace usages of OkHttp MockWebServer MockResponse with 5.x MockWebServer3 MockResponse and it's Builder.

org.openrewrite.java.testing.junit5.UpdateMockWebServerMockResponse
mod run . --recipe=org.openrewrite.java.testing.junit5.UpdateMockWebServerMockResponse

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Change method invocation return type
  2. Change method name okhttp3.mockwebserver.MockResponse#setBody(*) to body
  3. Change method invocation return type
  4. Change method name okhttp3.mockwebserver.MockResponse#setTrailers(okhttp3.Headers) to trailers
  5. Change method invocation return type
  6. Change method name okhttp3.mockwebserver.MockResponse#setChunkedBody(*, int) to chunkedBody
  7. Change method invocation return type
  8. Change method name okhttp3.mockwebserver.MockResponse#withSettings(okhttp3.internal.http2.Settings) to settings
  9. Change method invocation return type
  10. Change method name okhttp3.mockwebserver.MockResponse#setStatus(java.lang.String) to status
  11. Change method invocation return type
  12. Change method name okhttp3.mockwebserver.MockResponse#setBodyDelay(long, java.util.concurrent.TimeUnit) to bodyDelay
  13. Change method invocation return type
  14. Change method name okhttp3.mockwebserver.MockResponse#setHeadersDelay(long, java.util.concurrent.TimeUnit) to headersDelay
  15. Change method invocation return type
  16. Change method name okhttp3.mockwebserver.MockResponse#withWebSocketUpgrade(okhttp3.WebSocketListener) to webSocketUpgrade
  17. Change method invocation return type
  18. Change method name okhttp3.mockwebserver.MockResponse#setResponseCode(int) to code
  19. Change method invocation return type
  20. Change method name okhttp3.mockwebserver.MockResponse#withPush(okhttp3.mockwebserver.PushPromise) to addPush
  21. Change method invocation return type
  22. Change method name okhttp3.mockwebserver.MockResponse#setHeaders(okhttp3.Headers) to headers
  23. Change method invocation return type
  24. Change method invocation return type
  25. Change method invocation return type
  26. Change method name okhttp3.mockwebserver.RecordedRequest getPath() to getTarget
  27. Change method name okhttp3.mockwebserver.RecordedRequest getRequestUrl() to getUrl
  28. Preserve MockResponse return type for Dispatcher.dispatch() overrides
  29. Change type MockResponse to MockResponse$Builder
  30. Rename package name okhttp3.mockwebserver to mockwebserver3