Skip to content

Commit 25d59dc

Browse files
author
Stephane Landelle
committed
Clean tests
1 parent 79b8028 commit 25d59dc

File tree

4 files changed

+193
-298
lines changed

4 files changed

+193
-298
lines changed

api/src/test/java/org/asynchttpclient/async/AbstractBasicTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ public void tearDownGlobal() throws Exception {
216216
server.stop();
217217
}
218218

219-
protected int findFreePort() throws IOException {
219+
protected synchronized int findFreePort() throws IOException {
220220
ServerSocket socket = null;
221221

222222
try {

api/src/test/java/org/asynchttpclient/async/BasicHttpsTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,9 @@ public void reconnectsAfterFailedCertificationPath() throws Throwable {
200200
Throwable cause = e.getCause();
201201
if (cause instanceof ConnectException) {
202202
assertNotNull(cause.getCause());
203-
assertTrue(cause.getCause() instanceof SSLHandshakeException);
203+
assertTrue(cause.getCause() instanceof SSLHandshakeException, "Expected an SSLHandshakeException, got a " + cause.getCause());
204204
} else {
205-
assertTrue(cause instanceof SSLHandshakeException);
205+
assertTrue(cause.getCause() instanceof SSLHandshakeException, "Expected an SSLHandshakeException, got a " + cause);
206206
}
207207
}
208208

0 commit comments

Comments
 (0)