|
14 | 14 | package feign.client; |
15 | 15 |
|
16 | 16 | import static org.assertj.core.api.Assertions.assertThat; |
| 17 | +import static org.assertj.core.api.Assertions.entry; |
17 | 18 | import static org.hamcrest.core.Is.isA; |
18 | 19 | import static org.junit.Assert.assertEquals; |
19 | 20 |
|
|
22 | 23 | import feign.Feign; |
23 | 24 | import feign.Feign.Builder; |
24 | 25 | import feign.RetryableException; |
| 26 | +import feign.assertj.MockWebServerAssertions; |
25 | 27 | import java.io.IOException; |
26 | 28 | import java.net.HttpURLConnection; |
27 | 29 | import java.net.InetSocketAddress; |
|
30 | 32 | import java.net.Proxy.Type; |
31 | 33 | import java.net.SocketAddress; |
32 | 34 | import java.net.URL; |
| 35 | +import java.util.Collections; |
33 | 36 | import javax.net.ssl.HostnameVerifier; |
34 | 37 | import javax.net.ssl.SSLSession; |
35 | 38 | import okhttp3.mockwebserver.MockResponse; |
@@ -92,6 +95,22 @@ public void testPatch() throws Exception { |
92 | 95 | super.testPatch(); |
93 | 96 | } |
94 | 97 |
|
| 98 | + @Override |
| 99 | + public void noResponseBodyForPost() throws Exception { |
| 100 | + super.noResponseBodyForPost(); |
| 101 | + MockWebServerAssertions.assertThat(server.takeRequest()) |
| 102 | + .hasMethod("POST") |
| 103 | + .hasHeaders(entry("Content-Length", Collections.singletonList("0"))); |
| 104 | + } |
| 105 | + |
| 106 | + @Override |
| 107 | + public void noResponseBodyForPut() throws Exception { |
| 108 | + super.noResponseBodyForPut(); |
| 109 | + MockWebServerAssertions.assertThat(server.takeRequest()) |
| 110 | + .hasMethod("PUT") |
| 111 | + .hasHeaders(entry("Content-Length", Collections.singletonList("0"))); |
| 112 | + } |
| 113 | + |
95 | 114 | @Test |
96 | 115 | @Override |
97 | 116 | public void noResponseBodyForPatch() { |
|
0 commit comments