Skip to content

Commit

Permalink
chore(mockwebserver): migration guide entry
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Nuri <marc@marcnuri.com>
  • Loading branch information
manusa committed Oct 21, 2024
1 parent 0cfecfc commit a47f377
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#### New Features
* Fix #6150: Config uses `proxy-url` in kubeconfig's cluster configuration
* Fix #5719: io.fabric8:mockwebserver is now based on Vert.x

#### _**Note**_: Breaking changes
* Check detailed migration documentation for breaking changes in [7.0.0](./doc/MIGRATION-v7.md)
Expand Down
37 changes: 37 additions & 0 deletions doc/MIGRATION-v7.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
- [Renamed machineconfig to machineconfiguration](#openshift-machineconfig-to-machineconfiguration)
- [Tekton Extension](#tekton-extension)
- [Vertical Pod Autoscaler Extension](#vertical-pod-autoscaler-extension)
- [MockWebServer is based on Vert.x](#mockwebserver-vertx)
- [OkHttp class replacements](#mockwebserver-okhttp-replacements)
- [SSL/TLS certificates](#mockwebserver-ssl-tls-certificates)
- [Deprecations and Removals](#deprecations-and-removals)
- [Service Catalog API (extension) removed](#service-catalog-extension)

Expand Down Expand Up @@ -132,6 +135,40 @@ The module `verticalpodautoscaler-model-v1` has been renamed to `verticalpodauto

The package containing the Vertical Pod Autoscaler classes has also been renamed from `io.fabric8.verticalpodautoscaler.api.model` to `io.fabric8.autoscaling.api.model.v1`.

## MockWebServer is based on Vert.x <a href="#mockwebserver-vertx" id="mockwebserver-vertx"/>

MockWebServer is no longer based on OkHttp, but on Vert.x instead.

### OkHttp class replacements <a href="#mockwebserver-okhttp-replacements" id="mockwebserver-okhttp-replacements"/>

As part of this change, the OkHttp dependency has been completely removed from all the MockWebServer related modules.

The `okhttp3`, `okhttp3.mockwebserver` and `okio` package classes have been replaced by equivalent classes.
The following table contains the mapping of the classes:

| OkHttp Class Name | New Class Name |
|-----------------------------------------|---------------------------------------------------|
| `okhttp3.Headers` | `io.fabric8.mockwebserver.http.Headers` |
| `okhttp3.HttpUrl` | `io.fabric8.mockwebserver.http.HttpUrl` |
| `okhttp3.MediaType` | `io.fabric8.mockwebserver.http.MediaType` |
| `okhttp3.Protocol` | `io.fabric8.mockwebserver.vertx.Protocol` |
| `okhttp3.Response` | `io.fabric8.mockwebserver.http.Response` |
| `okhttp3.WebSocket` | `io.fabric8.mockwebserver.http.WebSocket` |
| `okhttp3.WebSocketListener` | `io.fabric8.mockwebserver.http.WebSocketListener` |
| `okhttp3.mockwebserver.Dispatcher` | `io.fabric8.mockwebserver.http.Dispatcher` |
| `okhttp3.mockwebserver.MockResponse` | `io.fabric8.mockwebserver.http.MockResponse` |
| `okhttp3.mockwebserver.MockWebServer` | `io.fabric8.mockwebserver.MockWebServer` |
| `okhttp3.mockwebserver.QueueDispatcher` | `io.fabric8.mockwebserver.http.QueueDispatcher` |
| `okhttp3.mockwebserver.RecordedRequest` | `io.fabric8.mockwebserver.http.RecordedRequest` |
| `okio.Buffer` | `io.fabric8.mockwebserver.http.Buffer` |
| `okio.ByteString` | `io.fabric8.mockwebserver.http.ByteString` |

### SSL/TLS certificates <a href="#mockwebserver-ssl-tls-certificates" id="mockwebserver-ssl-tls-certificates"/>

The MockWebServer will now use self-signed certificates that are generated each time the server is started.
In the prior version, the MockWebServer used a set of hardcoded certificates that were distributed with the `io.fabric8:mockwebserver` module artifact.
If you need the certificates (public and private), you can retrieve them by using the new `MockWebServer#getSelfSignedCertificate` method.

## Deprecations and Removals <a href="#deprecations-and-removals" id="deprecations-and-removals"/>

### Service Catalog API (extension) removed <a href="#service-catalog-extension" id="service-catalog-extension"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ class MockWebServerWebSocketTest extends Specification {
when: "The connection completes"
condition.eventually {
assert wsReq.isComplete()
assert wsReq.result() != null
assert wsReq.result().closeReason() != null
}

then: "The received message should be the expected one"
Expand Down

0 comments on commit a47f377

Please sign in to comment.