Proper use of JUnit APIs

This commit is contained in:
Gary Gregory 2023-09-30 10:38:15 -04:00
parent 2e5c8225e9
commit 5d2557714c
1 changed files with 2 additions and 6 deletions

View File

@ -20,6 +20,7 @@ package org.apache.commons.csv.issues;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.IOException;
@ -70,12 +71,7 @@ public class JiraCsv248Test {
assertFalse(rec.isSet("A"));
assertEquals(0, rec.toMap().size());
// This will throw
try {
rec.get("A");
org.junit.jupiter.api.Assertions.fail("Access by name is not expected after deserialisation");
} catch (final IllegalStateException expected) {
// OK
}
assertThrows(IllegalStateException.class, () -> rec.get("A"));
}
}
}