Skip to content

Commit 4d4d748

Browse files
committed
refactor: make AbstractHttpClientProxyTest less reliant on OkHttp internals
Signed-off-by: Marc Nuri <marc@marcnuri.com>
1 parent 5ad8f3b commit 4d4d748

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

kubernetes-client-api/src/test/java/io/fabric8/kubernetes/client/http/AbstractHttpClientProxyTest.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,13 @@
1616
package io.fabric8.kubernetes.client.http;
1717

1818
import io.fabric8.mockwebserver.DefaultMockServer;
19-
import okhttp3.Headers;
2019
import okhttp3.mockwebserver.RecordedRequest;
2120
import org.junit.jupiter.api.AfterAll;
2221
import org.junit.jupiter.api.BeforeAll;
2322
import org.junit.jupiter.api.DisplayName;
2423
import org.junit.jupiter.api.Test;
2524

2625
import java.net.InetSocketAddress;
27-
import java.util.Collections;
2826
import java.util.concurrent.TimeUnit;
2927

3028
import static org.assertj.core.api.Assertions.assertThat;
@@ -61,9 +59,8 @@ protected void proxyConfigurationAddsRequiredHeaders() throws Exception {
6159
// Then
6260
assertThat(server.getLastRequest())
6361
.extracting(RecordedRequest::getHeaders)
64-
.extracting(Headers::toMultimap)
65-
.hasFieldOrPropertyWithValue("Host", Collections.singletonList("0.0.0.0:" + server.getPort()))
66-
.hasFieldOrPropertyWithValue("Proxy-Authorization", Collections.singletonList("auth:cred"));
62+
.returns("0.0.0.0:" + server.getPort(), h -> h.get("Host"))
63+
.returns("auth:cred", h -> h.get("Proxy-Authorization"));
6764
}
6865
}
6966
}

0 commit comments

Comments
 (0)