rework test

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1898212 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2022-02-19 11:41:46 +00:00
parent 1fa2dcd8ec
commit 4998436a00

View 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.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull; 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.ByteArrayInputStream;
import java.io.IOException; import java.io.IOException;
@ -55,11 +55,10 @@ public final class TestTNEFAttributes {
@Test @Test
void testMalformedTNEF() throws Exception { void testMalformedTNEF() throws Exception {
try (InputStream is = _samples.openResourceAsStream("oom.tnef")) { try (InputStream is = _samples.openResourceAsStream("oom.tnef")) {
quick = new HMEFMessage(is); assertThrows(IOException.class, ()-> new HMEFMessage(is));
} catch (Exception e) {
assertTrue(e instanceof IOException);
} }
} }
/** /**
* Test counts * Test counts
*/ */