Skip to content

Commit 5912d28

Browse files
committed
[CODEC-155] DigestUtils.getDigest(String) should throw IllegalArgumentException instead of RuntimeException. Use JUnit 4 expected annotation to test instead of try/catch block.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@1380024 13f79535-47bb-0310-9956-ffa450edef68
1 parent 33b47aa commit 5912d28

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

src/test/java/org/apache/commons/codec/digest/DigestUtilsTest.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,9 @@ public void testConstructable() {
5555
assertNotNull(new DigestUtils());
5656
}
5757

58-
@Test
58+
@Test(expected=IllegalArgumentException.class)
5959
public void testInternalNoSuchAlgorithmException() {
60-
try {
61-
DigestUtils.getDigest("Bogus Bogus");
62-
fail("A RuntimeException should have been thrown.");
63-
} catch (RuntimeException e) {
64-
// Expected exception.
65-
}
60+
DigestUtils.getDigest("Bogus Bogus");
6661
}
6762

6863
@Test

0 commit comments

Comments
 (0)