Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CSV-252: Clean up exception handling (#50)
* CSV-252: Clean up assertions using assertThrows As a followup to commit e2f0a4d that introduced JUnit Jupiter to the project, this patch leverages the new Assertions#assertThrows method to clean up tests for expected exceptions. Instead of the somewhat clunky structure common in JUnit 4 tests: ``` try { someMethod(); fail("SomeException should be thrown"); } catch (SomeException e) { // Expected... // Possibly some assertion on e } ``` JUnit Jupiter allows the following elegant syntax: ``` SomeException e = assertThrows(SomeException.class, () -> someMethod()); // Possibly some assertions on e ``` * CSV-252: Remove redundant throws clauses from tests
- Loading branch information
1 parent
0300569
commit 485929e
Showing
4 changed files
with
24 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters