]> source.dussan.org Git - poi.git/commitdiff
rework test
authorPJ Fanning <fanningpj@apache.org>
Sat, 19 Feb 2022 11:41:46 +0000 (11:41 +0000)
committerPJ Fanning <fanningpj@apache.org>
Sat, 19 Feb 2022 11:41:46 +0000 (11:41 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1898212 13f79535-47bb-0310-9956-ffa450edef68

poi-scratchpad/src/test/java/org/apache/poi/hmef/attribute/TestTNEFAttributes.java

index 7d8869988e7e2c2ec04cab77e15a5eb85d9d438d..d644debe5c3a5ac7c710d677489fafac07a44865 100644 (file)
@@ -19,7 +19,7 @@ package org.apache.poi.hmef.attribute;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
@@ -55,11 +55,10 @@ public final class TestTNEFAttributes {
     @Test
     void testMalformedTNEF() throws Exception {
         try (InputStream is = _samples.openResourceAsStream("oom.tnef")) {
-            quick = new HMEFMessage(is);
-        } catch (Exception e) {
-            assertTrue(e instanceof IOException);
+            assertThrows(IOException.class, ()-> new HMEFMessage(is));
         }
     }
+
     /**
      * Test counts
      */