diff --git a/src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.java b/src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.java index c2f2f6f50..de57cab2d 100644 --- a/src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.java +++ b/src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.java @@ -79,15 +79,9 @@ public class ToStringBuilderTest { } } - @Test + @Test(expected=IllegalArgumentException.class) public void testSetDefaultEx() { - try { - ToStringBuilder.setDefaultStyle(null); - - } catch (IllegalArgumentException ex) { - return; - } - fail(); + ToStringBuilder.setDefaultStyle(null); } @Test