|
16 | 16 |
|
17 | 17 | package org.springframework.ws.transport.http;
|
18 | 18 |
|
| 19 | +import static org.assertj.core.api.AssertionsForClassTypes.*; |
| 20 | +import static org.springframework.ws.transport.http.HttpComponents5ClientFactory.*; |
| 21 | + |
19 | 22 | import jakarta.servlet.http.HttpServlet;
|
20 | 23 | import jakarta.servlet.http.HttpServletRequest;
|
21 | 24 | import jakarta.servlet.http.HttpServletResponse;
|
22 | 25 | import jakarta.xml.soap.MessageFactory;
|
| 26 | + |
| 27 | +import java.io.IOException; |
| 28 | +import java.net.URI; |
| 29 | +import java.util.HashMap; |
| 30 | +import java.util.Map; |
| 31 | + |
23 | 32 | import org.apache.hc.client5.http.HttpRoute;
|
24 |
| -import org.apache.hc.client5.http.classic.ExecChainHandler; |
25 | 33 | import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
|
26 |
| -import org.apache.hc.client5.http.impl.classic.HttpClientBuilder; |
27 | 34 | import org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager;
|
28 | 35 | import org.apache.hc.core5.http.HttpHost;
|
29 | 36 | import org.eclipse.jetty.server.Connector;
|
|
38 | 45 | import org.springframework.ws.transport.WebServiceConnection;
|
39 | 46 | import org.springframework.ws.transport.support.FreePortScanner;
|
40 | 47 |
|
41 |
| -import java.io.IOException; |
42 |
| -import java.net.URI; |
43 |
| -import java.util.HashMap; |
44 |
| -import java.util.Map; |
45 |
| - |
46 |
| -import static org.assertj.core.api.AssertionsForClassTypes.assertThat; |
47 |
| -import static org.springframework.ws.transport.http.HttpComponents5ClientFactory.getPort; |
48 |
| - |
49 | 48 | class HttpComponents5MessageSenderIntegrationTest
|
50 | 49 | extends AbstractHttpWebServiceMessageSenderIntegrationTestCase<HttpComponents5MessageSender> {
|
51 | 50 |
|
52 |
| - private static CloseableHttpClient createHttpClientWithAssertion() { |
53 |
| - ExecChainHandler handler = (request, scope, chain) -> { |
54 |
| - assertThat(request.getEntity().getContentType()) |
55 |
| - .describedAs("Exec interceptors are supposed to receive content type. Verify that HttpEntity class is instantiated correctly") |
56 |
| - .isNotBlank(); |
57 |
| - return chain.proceed(request, scope); |
58 |
| - }; |
59 |
| - return HttpClientBuilder.create() |
60 |
| - .addRequestInterceptorFirst(new HttpComponents5MessageSender.RemoveSoapHeadersInterceptor()) |
61 |
| - .addExecInterceptorFirst("logbook-alike exec interceptor", handler) |
62 |
| - .build(); |
63 |
| - } |
64 |
| - |
65 | 51 | @Override
|
66 | 52 | protected HttpComponents5MessageSender createMessageSender() {
|
67 |
| - return new HttpComponents5MessageSender(createHttpClientWithAssertion()); |
| 53 | + return new HttpComponents5MessageSender(); |
68 | 54 | }
|
69 | 55 |
|
70 | 56 | @Test // GH-1164
|
|
0 commit comments