39
39
import software .amazon .awssdk .http .SdkHttpRequest ;
40
40
import software .amazon .awssdk .utils .AttributeMap ;
41
41
42
- public class UrlConnectionHttpClientWithProxyTest {
42
+ class UrlConnectionHttpClientWithProxyTest {
43
43
@ RegisterExtension
44
44
static WireMockExtension httpsWm = WireMockExtension .newInstance ()
45
45
.options (wireMockConfig ().dynamicPort ().dynamicHttpsPort ())
@@ -53,7 +53,7 @@ public class UrlConnectionHttpClientWithProxyTest {
53
53
private SdkHttpClient client ;
54
54
55
55
@ Test
56
- void Http_ProxyCallFrom_Https_Client () throws IOException {
56
+ void Http_ProxyCallFrom_Https_Client_getsRejectedWith_404 () throws IOException {
57
57
httpWm .stubFor (requestMatching (
58
58
request -> MatchResult .of (request .getUrl ().contains (anyString ()))
59
59
).willReturn (aResponse ()));
@@ -67,7 +67,7 @@ void Http_ProxyCallFrom_Https_Client() throws IOException {
67
67
}
68
68
69
69
@ Test
70
- void Http_ProxyCallFromWithDenyList_Https_Client () throws IOException {
70
+ void Http_ProxyCallFromWithDenyList_HttpsClient_bypassesProxy_AndReturns_OK () throws IOException {
71
71
httpWm .stubFor (requestMatching (
72
72
request -> MatchResult .of (request .getUrl ().contains (anyString ()))
73
73
).willReturn (aResponse ()));
@@ -84,7 +84,7 @@ void Http_ProxyCallFromWithDenyList_Https_Client() throws IOException {
84
84
}
85
85
86
86
@ Test
87
- void emptyProxyConfig_Https_Client () throws IOException {
87
+ void emptyProxyConfig_Https_Client_byPassesProxy_dReturns_OK () throws IOException {
88
88
httpWm .stubFor (requestMatching (
89
89
request -> MatchResult .of (request .getUrl ().contains (anyString ()))
90
90
).willReturn (aResponse ()));
@@ -99,7 +99,7 @@ void emptyProxyConfig_Https_Client() throws IOException {
99
99
}
100
100
101
101
@ Test
102
- void http_ProxyCallFrom_Http_Client () throws IOException {
102
+ void http_ProxyCallFrom_Http_Client_isAcceptedByHttpProxy_AndReturns_OK () throws IOException {
103
103
104
104
httpWm .stubFor (requestMatching (
105
105
request -> MatchResult .of (request .getUrl ().contains (anyString ()))
@@ -131,7 +131,6 @@ private HttpExecuteResponse makeRequestWithHttps_Client(SdkHttpClient httpClient
131
131
return httpClient .prepareRequest (request ).call ();
132
132
}
133
133
134
-
135
134
private HttpExecuteResponse makeRequestWithHttp_Client (SdkHttpClient httpClient , WireMockRuntimeInfo wm ) throws IOException {
136
135
SdkHttpRequest httpRequest = SdkHttpFullRequest .builder ()
137
136
.method (SdkHttpMethod .GET )
@@ -146,7 +145,6 @@ private HttpExecuteResponse makeRequestWithHttp_Client(SdkHttpClient httpClient,
146
145
return httpClient .prepareRequest (request ).call ();
147
146
}
148
147
149
-
150
148
private SdkHttpClient createHttpsClientForHttpServer (ProxyConfiguration proxyConfiguration ) {
151
149
152
150
UrlConnectionHttpClient .Builder builder =
@@ -155,5 +153,4 @@ private SdkHttpClient createHttpsClientForHttpServer(ProxyConfiguration proxyCon
155
153
attributeMap .put (TRUST_ALL_CERTIFICATES , true );
156
154
return builder .buildWithDefaults (attributeMap .build ());
157
155
}
158
-
159
156
}
0 commit comments