|
7 | 7 | import java.net.URI; |
8 | 8 | import java.net.http.HttpClient; |
9 | 9 | import java.net.http.HttpRequest; |
10 | | -import java.net.http.HttpResponse; |
11 | 10 | import java.time.Duration; |
12 | 11 | import java.util.Map; |
13 | | -import java.util.concurrent.CompletableFuture; |
14 | 12 | import java.util.concurrent.atomic.AtomicBoolean; |
15 | 13 | import java.util.concurrent.atomic.AtomicInteger; |
16 | 14 | import java.util.concurrent.atomic.AtomicReference; |
|
22 | 20 | import org.junit.jupiter.api.BeforeEach; |
23 | 21 | import org.junit.jupiter.api.Test; |
24 | 22 | import org.junit.jupiter.api.Timeout; |
25 | | -import org.mockito.ArgumentCaptor; |
26 | | -import org.mockito.Mockito; |
| 23 | + |
27 | 24 | import org.testcontainers.containers.GenericContainer; |
28 | 25 | import org.testcontainers.containers.wait.strategy.Wait; |
29 | 26 | import reactor.core.publisher.Mono; |
|
34 | 31 |
|
35 | 32 | import static org.assertj.core.api.Assertions.assertThat; |
36 | 33 | import static org.assertj.core.api.Assertions.assertThatCode; |
37 | | -import static org.mockito.ArgumentMatchers.any; |
38 | | -import static org.mockito.Mockito.verify; |
39 | | -import static org.mockito.Mockito.when; |
40 | 34 |
|
41 | 35 | import com.fasterxml.jackson.databind.ObjectMapper; |
42 | 36 |
|
@@ -370,25 +364,4 @@ void testChainedCustomizations() { |
370 | 364 | customizedTransport.closeGracefully().block(); |
371 | 365 | } |
372 | 366 |
|
373 | | - @Test |
374 | | - @SuppressWarnings("unchecked") |
375 | | - void testResolvingClientEndpoint() { |
376 | | - HttpClient httpClient = Mockito.mock(HttpClient.class); |
377 | | - HttpResponse<Void> httpResponse = Mockito.mock(HttpResponse.class); |
378 | | - CompletableFuture<HttpResponse<Void>> future = new CompletableFuture<>(); |
379 | | - future.complete(httpResponse); |
380 | | - when(httpClient.sendAsync(any(HttpRequest.class), any(HttpResponse.BodyHandler.class))).thenReturn(future); |
381 | | - |
382 | | - HttpClientSseClientTransport transport = new HttpClientSseClientTransport(httpClient, HttpRequest.newBuilder(), |
383 | | - "http://example.com", "http://example.com/sse", new ObjectMapper()); |
384 | | - |
385 | | - transport.connect(Function.identity()); |
386 | | - |
387 | | - ArgumentCaptor<HttpRequest> httpRequestCaptor = ArgumentCaptor.forClass(HttpRequest.class); |
388 | | - verify(httpClient).sendAsync(httpRequestCaptor.capture(), any(HttpResponse.BodyHandler.class)); |
389 | | - assertThat(httpRequestCaptor.getValue().uri()).isEqualTo(URI.create("http://example.com/sse")); |
390 | | - |
391 | | - transport.closeGracefully().block(); |
392 | | - } |
393 | | - |
394 | 367 | } |
0 commit comments