garydgregory commented on code in PR #121:
URL: https://github.com/apache/commons-net/pull/121#discussion_r1014692159


##########
src/test/java/org/apache/commons/net/smtp/SimpleSMTPHeaderTestCase.java:
##########
@@ -103,9 +105,10 @@ public void testToStringAddHeaderDate() {
         assertEquals("Date: dummy date\nFrom: [email protected]\n\n", 
hdr.toString());
     }
 
-    @Test(expected=IllegalArgumentException.class)
+    @Test
     public void testToStringNoFrom() {
-        new SimpleSMTPHeader(null, null, null);
+        final Executable testMethod = () -> new SimpleSMTPHeader(null, null, 
null);
+        assertThrows(IllegalArgumentException.class, testMethod);

Review Comment:
   The local variable is not needed and feels like it just clutters up the code.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to