Skip to content

Commit 5d25577

Browse files
committed
Proper use of JUnit APIs
1 parent 2e5c822 commit 5d25577

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

src/test/java/org/apache/commons/csv/issues/JiraCsv248Test.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import static org.junit.jupiter.api.Assertions.assertEquals;
2121
import static org.junit.jupiter.api.Assertions.assertFalse;
2222
import static org.junit.jupiter.api.Assertions.assertNull;
23+
import static org.junit.jupiter.api.Assertions.assertThrows;
2324
import static org.junit.jupiter.api.Assertions.assertTrue;
2425

2526
import java.io.IOException;
@@ -70,12 +71,7 @@ public void testJiraCsv248() throws IOException, ClassNotFoundException {
7071
assertFalse(rec.isSet("A"));
7172
assertEquals(0, rec.toMap().size());
7273
// This will throw
73-
try {
74-
rec.get("A");
75-
org.junit.jupiter.api.Assertions.fail("Access by name is not expected after deserialisation");
76-
} catch (final IllegalStateException expected) {
77-
// OK
78-
}
74+
assertThrows(IllegalStateException.class, () -> rec.get("A"));
7975
}
8076
}
8177
}

0 commit comments

Comments
 (0)