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;
@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
*/