@@ -59,6 +59,7 @@ private static String getTargetUrl() {
59
59
60
60
@ Test
61
61
public void postBodyOverHttps () throws Throwable {
62
+ logger .debug (">>> postBodyOverHttps" );
62
63
withClient (config ().setSslEngineFactory (createSslEngineFactory ())).run (client -> {
63
64
withServer (server ).run (server -> {
64
65
server .enqueueEcho ();
@@ -69,28 +70,31 @@ public void postBodyOverHttps() throws Throwable {
69
70
assertEquals (resp .getResponseBody (), SIMPLE_TEXT_FILE_STRING );
70
71
});
71
72
});
73
+ logger .debug ("<<< postBodyOverHttps" );
72
74
}
73
75
74
76
@ Test
75
77
public void multipleSequentialPostRequestsOverHttps () throws Throwable {
78
+ logger .debug (">>> multipleSequentialPostRequestsOverHttps" );
76
79
withClient (config ().setSslEngineFactory (createSslEngineFactory ())).run (client -> {
77
80
withServer (server ).run (server -> {
78
81
server .enqueueEcho ();
79
82
server .enqueueEcho ();
80
83
81
84
String body = "hello there" ;
82
-
83
85
Response response = client .preparePost (getTargetUrl ()).setBody (body ).setHeader (CONTENT_TYPE , "text/html" ).execute ().get (TIMEOUT , SECONDS );
84
86
assertEquals (response .getResponseBody (), body );
85
87
86
88
response = client .preparePost (getTargetUrl ()).setBody (body ).setHeader (CONTENT_TYPE , "text/html" ).execute ().get (TIMEOUT , SECONDS );
87
89
assertEquals (response .getResponseBody (), body );
88
90
});
89
91
});
92
+ logger .debug ("<<< multipleSequentialPostRequestsOverHttps" );
90
93
}
91
94
92
95
@ Test
93
96
public void multipleConcurrentPostRequestsOverHttpsWithDisabledKeepAliveStrategy () throws Throwable {
97
+ logger .debug (">>> multipleConcurrentPostRequestsOverHttpsWithDisabledKeepAliveStrategy" );
94
98
95
99
KeepAliveStrategy keepAliveStrategy = new KeepAliveStrategy () {
96
100
@ Override
@@ -114,14 +118,17 @@ public boolean keepAlive(Request ahcRequest, HttpRequest nettyRequest, HttpRespo
114
118
assertEquals (response .getResponseBody (), body );
115
119
});
116
120
});
121
+
122
+ logger .debug ("<<< multipleConcurrentPostRequestsOverHttpsWithDisabledKeepAliveStrategy" );
117
123
}
118
124
119
125
@ Test
120
126
public void reconnectAfterFailedCertificationPath () throws Throwable {
127
+ logger .debug (">>> reconnectAfterFailedCertificationPath" );
121
128
122
129
AtomicBoolean trust = new AtomicBoolean ();
123
130
124
- withClient (config ().setSslEngineFactory (createSslEngineFactory (trust ))).run (client -> {
131
+ withClient (config ().setMaxRequestRetry ( 0 ). setSslEngineFactory (createSslEngineFactory (trust ))).run (client -> {
125
132
withServer (server ).run (server -> {
126
133
server .enqueueEcho ();
127
134
server .enqueueEcho ();
@@ -144,11 +151,14 @@ public void reconnectAfterFailedCertificationPath() throws Throwable {
144
151
assertEquals (response .getResponseBody (), body );
145
152
});
146
153
});
154
+ logger .debug ("<<< reconnectAfterFailedCertificationPath" );
147
155
}
148
156
149
157
@ Test (timeOut = 2000 , expectedExceptions = SSLHandshakeException .class )
150
158
public void failInstantlyIfNotAllowedSelfSignedCertificate () throws Throwable {
151
- withClient (config ().setRequestTimeout (2000 )).run (client -> {
159
+ logger .debug (">>> failInstantlyIfNotAllowedSelfSignedCertificate" );
160
+
161
+ withClient (config ().setMaxRequestRetry (0 ).setRequestTimeout (2000 )).run (client -> {
152
162
withServer (server ).run (server -> {
153
163
server .enqueueEcho ();
154
164
try {
@@ -158,10 +168,14 @@ public void failInstantlyIfNotAllowedSelfSignedCertificate() throws Throwable {
158
168
}
159
169
});
160
170
});
171
+ logger .debug ("<<< failInstantlyIfNotAllowedSelfSignedCertificate" );
172
+
161
173
}
162
174
163
175
@ Test (groups = "standalone" )
164
176
public void testNormalEventsFired () throws Throwable {
177
+ logger .debug (">>> testNormalEventsFired" );
178
+
165
179
withClient (config ().setSslEngineFactory (createSslEngineFactory ())).run (client -> {
166
180
withServer (server ).run (server -> {
167
181
EventCollectingHandler handler = new EventCollectingHandler ();
@@ -188,5 +202,6 @@ public void testNormalEventsFired() throws Throwable {
188
202
assertEquals (handler .firedEvents .toArray (), expectedEvents , "Got " + Arrays .toString (handler .firedEvents .toArray ()));
189
203
});
190
204
});
205
+ logger .debug ("<<< testNormalEventsFired" );
191
206
}
192
207
}
0 commit comments