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

commit 8c4ecf734e75bcb7c6fc2311fd28472a6bb86c10
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Sat Sep 30 10:39:58 2023 -0400

    Proper use of JUnit APIs
---
 src/test/java/org/apache/commons/csv/CSVRecordTest.java | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/test/java/org/apache/commons/csv/CSVRecordTest.java 
b/src/test/java/org/apache/commons/csv/CSVRecordTest.java
index db1ef40c..975d45a5 100644
--- a/src/test/java/org/apache/commons/csv/CSVRecordTest.java
+++ b/src/test/java/org/apache/commons/csv/CSVRecordTest.java
@@ -255,12 +255,7 @@ public class CSVRecordTest {
             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"));
         }
     }
 

Reply via email to