|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2024 the original author or authors. |
| 2 | + * Copyright 2002-2025 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
41 | 41 | import okio.Buffer;
|
42 | 42 | import org.apache.hc.client5.http.impl.async.HttpAsyncClientBuilder;
|
43 | 43 | import org.junit.jupiter.api.AfterEach;
|
| 44 | +import org.junit.jupiter.api.Assumptions; |
44 | 45 | import org.junit.jupiter.api.BeforeEach;
|
45 | 46 | import org.junit.jupiter.api.Named;
|
46 | 47 | import org.junit.jupiter.api.Test;
|
@@ -201,6 +202,25 @@ void cookieExpireValueSetAsMaxAge(ClientHttpConnector connector) {
|
201 | 202 | .verifyComplete();
|
202 | 203 | }
|
203 | 204 |
|
| 205 | + @ParameterizedConnectorTest |
| 206 | + void partitionedCookieSupport(ClientHttpConnector connector) { |
| 207 | + Assumptions.assumeFalse(connector instanceof JettyClientHttpConnector, "Jetty client does not support partitioned cookies"); |
| 208 | + Assumptions.assumeFalse(connector instanceof JdkClientHttpConnector, "JDK client does not support partitioned cookies"); |
| 209 | + prepareResponse(response -> { |
| 210 | + response.setResponseCode(200); |
| 211 | + response.addHeader("Set-Cookie", "id=test; Partitioned;"); |
| 212 | + }); |
| 213 | + Mono<ClientHttpResponse> futureResponse = |
| 214 | + connector.connect(HttpMethod.GET, this.server.url("/").uri(), ReactiveHttpOutputMessage::setComplete); |
| 215 | + StepVerifier.create(futureResponse) |
| 216 | + .assertNext(response -> { |
| 217 | + assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK); |
| 218 | + assertThat(response.getCookies().getFirst("id").isPartitioned()).isTrue(); |
| 219 | + } |
| 220 | + ) |
| 221 | + .verifyComplete(); |
| 222 | + } |
| 223 | + |
204 | 224 | @Test
|
205 | 225 | void disableCookieWithHttpComponents() {
|
206 | 226 | ClientHttpConnector connector = new HttpComponentsClientHttpConnector(
|
|
0 commit comments