From 3772a2ff2a87c6ad85af22a6bd8bae130ee84cf7 Mon Sep 17 00:00:00 2001 From: "Olivier B. OURA" Date: Sat, 17 Apr 2021 10:32:00 +0000 Subject: [PATCH] Add exception message to Throws test #1453 --- src/test/java/org/cactoos/bytes/HexOfTest.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/cactoos/bytes/HexOfTest.java b/src/test/java/org/cactoos/bytes/HexOfTest.java index 6af634228..0175776c8 100644 --- a/src/test/java/org/cactoos/bytes/HexOfTest.java +++ b/src/test/java/org/cactoos/bytes/HexOfTest.java @@ -68,19 +68,27 @@ public void validHex() throws Exception { ).affirm(); } + @Test public void invalidHexLength() throws Exception { new Assertion<>( "Must invalid hex length", () -> new HexOf(new TextOf("ABF")).asBytes(), - new Throws<>(IOException.class) + new Throws<>( + "Length of hexadecimal text is odd", + IOException.class + ) ).affirm(); } + @Test public void invalidHex() throws Exception { new Assertion<>( "Must invalid hex", () -> new HexOf(new TextOf("ABG!")).asBytes(), - new Throws<>(IOException.class) + new Throws<>( + "Unexpected character 'G'", + IOException.class + ) ).affirm(); } }