You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2022/11/07 15:36:30 UTC

[commons-net] branch master updated: Clean up JUnit5 assertThrows TestTimeInfo #120

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-net.git


The following commit(s) were added to refs/heads/master by this push:
     new d7eb3d91 Clean up JUnit5 assertThrows TestTimeInfo #120
d7eb3d91 is described below

commit d7eb3d916a450c0b81bd64f48492a7b8eed773fc
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Nov 7 10:36:25 2022 -0500

    Clean up JUnit5 assertThrows TestTimeInfo #120
---
 src/changes/changes.xml                                    | 6 ++++++
 src/test/java/org/apache/commons/net/ntp/TestTimeInfo.java | 3 +--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index cbc70e07..b63cf955 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -80,6 +80,12 @@ The <action> type attribute can be add,update,fix,remove.
       <action issue="NET-642" type="fix" dev="ggregory" due-to="Yani Mihaylov, Gary Gregory">
         FTPSClient execPROT removes proxy settings #90.
       </action>
+      <action type="fix" dev="ggregory" due-to="John Patrick, Gary Gregory">
+        JUnit5 assertThrows SimpleSMTPHeaderTestCase #121.
+      </action>
+      <action type="fix" dev="ggregory" due-to="John Patrick, Gary Gregory">
+        JUnit5 assertThrows TestTimeInfo #120.
+      </action>
       <!-- ADD -->
       <action type="add" dev="ggregory" due-to="Gary Gregory">
         [FTP] Add FTPClient.mdtmInstant(String).
diff --git a/src/test/java/org/apache/commons/net/ntp/TestTimeInfo.java b/src/test/java/org/apache/commons/net/ntp/TestTimeInfo.java
index 14c06d06..2d1622d9 100644
--- a/src/test/java/org/apache/commons/net/ntp/TestTimeInfo.java
+++ b/src/test/java/org/apache/commons/net/ntp/TestTimeInfo.java
@@ -92,8 +92,7 @@ public class TestTimeInfo {
     @Test
     public void testException() {
         final NtpV3Packet packet = null;
-        final Executable testMethod = () -> new TimeInfo(packet, 1L);
-        assertThrows(IllegalArgumentException.class, testMethod);
+        assertThrows(IllegalArgumentException.class, () -> new TimeInfo(packet, 1L));
     }
 
     @Test