Ensure SSLErrorTest also works with boringssl
Motivation:
boringssl uses different messages for the ssl alerts which are all uppercase. As we try to match case as well this fails in SSLErrorTest as we expect lower-case.
This test was introduced by 9b7fb2f362
.
Modifications:
Ensure we first translate everything to lower-case before doing the assert.
Result:
SSLErrorTest also pass when boringssl is used.
This commit is contained in:
parent
8d664fa0fd
commit
41ea9fa3b6
|
@ -58,6 +58,7 @@ import java.util.Collection;
|
|||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
|
||||
@RunWith(Parameterized.class)
|
||||
|
@ -238,7 +239,7 @@ public class SslErrorTest {
|
|||
// at the moment as there are no different exceptions for the different alerts.
|
||||
private static void verifyException(Throwable cause, String messagePart, Promise<Void> promise) {
|
||||
String message = cause.getMessage();
|
||||
if (message.contains(messagePart)) {
|
||||
if (message.toLowerCase(Locale.UK).contains(messagePart.toLowerCase(Locale.UK))) {
|
||||
promise.setSuccess(null);
|
||||
} else {
|
||||
promise.setFailure(new AssertionError("message not contains '" + messagePart + "': " + message));
|
||||
|
|
Loading…
Reference in New Issue