-
Notifications
You must be signed in to change notification settings - Fork 16
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
Migrate MockWebServer to JUnit 5 #1817
base: develop
Are you sure you want to change the base?
Conversation
@@ -40,7 +40,7 @@ org.jmock:jmock = 2.12.0 | |||
org.knowm.xchart:xchart = 3.6.1 | |||
com.palantir.conjure.verification:* = 0.19.0 | |||
io.undertow:undertow-core = 2.2.18.Final | |||
com.squareup.okhttp3:mockwebserver = 3.13.1 | |||
com.squareup.okhttp3:mockwebserver3-junit5 = 5.0.0-alpha.10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There hasn't been a non-alpha release of mockwebserver3-junit5
yet, but there have been many alpha releases over the past year and a half:
From https://search.maven.org/artifact/com.squareup.okhttp3/mockwebserver3-junit5
Version | Release Date |
---|---|
5.0.0-alpha.10 | 27-Jun-2022 |
5.0.0-alpha.9 | 16-Jun-2022 |
5.0.0-alpha.8 | 08-Jun-2022 |
5.0.0-alpha.7 | 26-Apr-2022 |
5.0.0-alpha.6 | 14-Mar-2022 |
5.0.0-alpha.5 | 21-Feb-2022 |
5.0.0-alpha.4 | 01-Feb-2022 |
5.0.0-alpha.3 | 22-Nov-2021 |
5.0.0-alpha.2 | 30-Jan-2021 |
@@ -97,6 +88,12 @@ public void close() {} | |||
|
|||
protected Channel channel; | |||
|
|||
protected final MockWebServer server; | |||
|
|||
protected AbstractChannelTest(MockWebServer server) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't see any tests out side this repo that extend this class, so while this is technically an API break I think we're fine
public final MockWebServer proxyServer = new MockWebServer(); | ||
private final MockWebServer proxyServer; | ||
|
||
protected AbstractProxyConfigTest(MockWebServer server, MockWebServer proxyServer) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't see any tests out side this repo that extend this class, so while this is technically an API break I think we're fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t believe we publish this module 👍
public final MockWebServer server = new MockWebServer(); | ||
private final MockWebServer server; | ||
|
||
protected AbstractSampleServiceClientTest(MockWebServer server) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't see any tests out side this repo that extend this class, so while this is technically an API break I think we're fine
@@ -107,7 +106,7 @@ public abstract class AbstractSampleServiceClientTest { | |||
|
|||
@BeforeEach | |||
public void before() { | |||
server.useHttps(SslSocketFactories.createSslSocketFactory(SSL_CONFIG), false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the removed argument was disabling tunnel proxy:
tunnelProxy true to expect the HTTP CONNECT method before negotiating TLS.
com.squareup.okhttp3:mockwebserver3-junit5:5.0.0-alpha.10 (1 constraints: c9071c72) | ||
com.squareup.okhttp3:okhttp:5.0.0-alpha.10 (1 constraints: 3a053f3b) | ||
com.squareup.okhttp3:okhttp-jvm:5.0.0-alpha.10 (2 constraints: 392169c2) | ||
com.squareup.okio:okio-jvm:3.2.0 (1 constraints: c90d9c38) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are all [Test dependencies]
changes (below line 64)
Before this PR
Using MockWebServer with JUnit 4 migration support
After this PR
Builds on top of #1815
==COMMIT_MSG==
MockWebServer JUnit 5
==COMMIT_MSG==
Possible downsides?