Skip to content
This repository was archived by the owner on Jun 3, 2026. It is now read-only.

Commit 8c4ecf7

Browse files
committed
Proper use of JUnit APIs
1 parent 5d25577 commit 8c4ecf7

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

src/test/java/org/apache/commons/csv/CSVRecordTest.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,7 @@ public void testSerialization() throws IOException, ClassNotFoundException {
255255
assertFalse(rec.isSet("A"));
256256
assertEquals(0, rec.toMap().size());
257257
// This will throw
258-
try {
259-
rec.get("A");
260-
org.junit.jupiter.api.Assertions.fail("Access by name is not expected after deserialisation");
261-
} catch (final IllegalStateException expected) {
262-
// OK
263-
}
258+
assertThrows(IllegalStateException.class, () -> rec.get("A"));
264259
}
265260
}
266261

0 commit comments

Comments
 (0)