This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-csv.git
The following commit(s) were added to refs/heads/master by this push: new 5d255771 Proper use of JUnit APIs 5d255771 is described below commit 5d2557714cf0966ff213a39a83ecbd971ccd4a8a Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Sat Sep 30 10:38:15 2023 -0400 Proper use of JUnit APIs --- src/test/java/org/apache/commons/csv/issues/JiraCsv248Test.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/test/java/org/apache/commons/csv/issues/JiraCsv248Test.java b/src/test/java/org/apache/commons/csv/issues/JiraCsv248Test.java index 84d274ac..d0a10300 100644 --- a/src/test/java/org/apache/commons/csv/issues/JiraCsv248Test.java +++ b/src/test/java/org/apache/commons/csv/issues/JiraCsv248Test.java @@ -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")); } } }