diff options
author | Håvard Pettersen <havardpe@oath.com> | 2018-09-26 12:14:34 +0000 |
---|---|---|
committer | Håvard Pettersen <havardpe@oath.com> | 2018-09-26 12:14:34 +0000 |
commit | 33d585cdb5be8199062516fa5301c487914de129 (patch) | |
tree | 1cef7af40f0d13ee92eb42582eb1357413a99552 /jrt | |
parent | 86af577637a859f1b0306a7d3b1c7221641ccd7c (diff) |
adjust message to work better with assertEquals
Diffstat (limited to 'jrt')
-rw-r--r-- | jrt/tests/com/yahoo/jrt/TlsDetectionTest.java | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/jrt/tests/com/yahoo/jrt/TlsDetectionTest.java b/jrt/tests/com/yahoo/jrt/TlsDetectionTest.java index db7dba313b4..47a8a20deab 100644 --- a/jrt/tests/com/yahoo/jrt/TlsDetectionTest.java +++ b/jrt/tests/com/yahoo/jrt/TlsDetectionTest.java @@ -5,18 +5,14 @@ import static org.junit.Assert.assertEquals; public class TlsDetectionTest { - static private String message(byte[] data, boolean actual) { - String msg = "["; + static private String message(byte[] data) { + String msg = "isTls(["; String delimiter = ""; for (byte b: data) { msg += delimiter + (b & 0xff); delimiter = ", "; } - if (actual) { - msg += "] wrongfully detected as tls"; - } else { - msg += "] wrongfully rejected as not tls"; - } + msg += "])"; return msg; } @@ -25,8 +21,7 @@ public class TlsDetectionTest { for (int i = 0; i < data.length; i++) { data[i] = (byte) values[i]; } - boolean actual = MaybeTlsCryptoSocket.looksLikeTlsToMe(data); - assertEquals(message(data, actual), expect, actual); + assertEquals(message(data), expect, MaybeTlsCryptoSocket.looksLikeTlsToMe(data)); } @org.junit.Test public void testValidHandshake() { |