Skip to content

Commit

Permalink
Revert "Don't test MockServer's HTTP proxy of an HTTP/2 call (square#…
Browse files Browse the repository at this point in the history
…8325)"

This reverts commit 3cde79c.
  • Loading branch information
yschimke committed Apr 21, 2024
1 parent d0d7557 commit b0b0c7d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions container-tests/src/test/java/okhttp3/containers/BasicProxyTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import okhttp3.containers.BasicMockServerTest.Companion.MOCKSERVER_IMAGE
import okhttp3.containers.BasicMockServerTest.Companion.trustMockServer
import okio.buffer
import okio.source
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
import org.mockserver.client.MockServerClient
import org.mockserver.configuration.Configuration
Expand Down Expand Up @@ -121,6 +122,27 @@ class BasicProxyTest {
}
}

@Test
@Disabled("https://github.com/square/okhttp/issues/8233")
fun testOkHttpSecureProxiedHttp2() {
testRequest {
val client =
OkHttpClient.Builder()
.trustMockServer()
.proxy(Proxy(Proxy.Type.HTTP, it.remoteAddress()))
.protocols(listOf(Protocol.HTTP_2, Protocol.HTTP_1_1))
.build()

val response =
client.newCall(
Request((mockServer.secureEndpoint + "/person?name=peter").toHttpUrl()),
).execute()

assertThat(response.body.string()).contains("Peter the person")
assertThat(response.protocol).isEqualTo(Protocol.HTTP_2)
}
}

@Test
fun testUrlConnectionDirect() {
testRequest {
Expand Down

0 comments on commit b0b0c7d

Please sign in to comment.