|
26 | 26 | import java.io.IOException; |
27 | 27 | import java.net.InetAddress; |
28 | 28 | import java.net.URISyntaxException; |
29 | | -import java.net.http.HttpHeaders; |
30 | 29 | import java.security.KeyStoreException; |
31 | 30 | import java.security.NoSuchAlgorithmException; |
32 | 31 | import java.security.UnrecoverableKeyException; |
33 | 32 | import java.security.cert.CertificateException; |
34 | 33 | import java.time.Duration; |
35 | 34 | import java.time.Instant; |
36 | 35 | import java.time.temporal.ChronoUnit; |
37 | | -import java.util.List; |
38 | 36 | import java.util.Map; |
39 | 37 | import java.util.Optional; |
40 | 38 | import java.util.concurrent.ExecutionException; |
41 | 39 | import java.util.function.Supplier; |
42 | 40 | import com.influxdb.v3.client.AbstractMockServerTest; |
43 | 41 | import com.influxdb.v3.client.InfluxDBApiException; |
44 | | -import com.influxdb.v3.client.InfluxDBApiHttpException; |
45 | 42 | import com.influxdb.v3.client.InfluxDBApiNettyException; |
46 | 43 | import com.influxdb.v3.client.InfluxDBClient; |
47 | 44 | import com.influxdb.v3.client.TestUtils; |
48 | 45 | import com.influxdb.v3.client.config.ClientConfig; |
49 | 46 | import com.influxdb.v3.client.config.NettyHttpClientConfig; |
50 | 47 | import com.influxdb.v3.client.write.WriteOptions; |
51 | | -import static org.assertj.core.api.AssertionsForClassTypes.catchThrowable; |
| 48 | +import io.netty.handler.codec.http.DefaultHttpHeaders; |
| 49 | +import io.netty.handler.codec.http.HttpHeaders; |
52 | 50 | import io.netty.handler.codec.http.HttpMethod; |
53 | 51 | import io.netty.handler.proxy.HttpProxyHandler; |
54 | 52 | import io.netty.handler.ssl.JdkSslContext; |
|
63 | 61 | import org.junit.jupiter.api.AfterEach; |
64 | 62 | import org.junit.jupiter.api.Test; |
65 | 63 |
|
| 64 | +import static org.assertj.core.api.AssertionsForClassTypes.catchThrowable; |
| 65 | + |
66 | 66 | public class RestClientTest extends AbstractMockServerTest { |
67 | 67 |
|
68 | 68 | private RestClient restClient; |
@@ -419,12 +419,11 @@ public void errorFromBodyText() throws URISyntaxException, IOException { |
419 | 419 |
|
420 | 420 | @Test |
421 | 421 | public void generateHttpException() { |
422 | | - HttpHeaders headers = HttpHeaders.of(Map.of( |
423 | | - "content-type", List.of("application/json"), |
424 | | - "retry-after", List.of("300")), |
425 | | - (key, value) -> true); |
| 422 | + HttpHeaders headers = new DefaultHttpHeaders(); |
| 423 | + headers.add("content-type", "application/json"); |
| 424 | + headers.add("retry-after", "300"); |
426 | 425 |
|
427 | | - InfluxDBApiHttpException exception = new InfluxDBApiHttpException( |
| 426 | + InfluxDBApiNettyException exception = new InfluxDBApiNettyException( |
428 | 427 | new InfluxDBApiException("test exception"), headers, 418); |
429 | 428 |
|
430 | 429 | Assertions.assertThat(exception.headers()).isEqualTo(headers); |
|
0 commit comments