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 f450715e Partial apply of PR #119 from 
https://github.com/apache/commons-net/pull/119
f450715e is described below

commit f450715efa6a8ee6511f23410ebd22789a7c85b4
Author: Gary Gregory <[email protected]>
AuthorDate: Mon Nov 7 10:39:25 2022 -0500

    Partial apply of PR #119 from
    https://github.com/apache/commons-net/pull/119
---
 src/test/java/org/apache/commons/net/ntp/TestNtpPacket.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/test/java/org/apache/commons/net/ntp/TestNtpPacket.java 
b/src/test/java/org/apache/commons/net/ntp/TestNtpPacket.java
index 9fc2bf42..f08f1ea4 100644
--- a/src/test/java/org/apache/commons/net/ntp/TestNtpPacket.java
+++ b/src/test/java/org/apache/commons/net/ntp/TestNtpPacket.java
@@ -16,10 +16,13 @@
  */
 package org.apache.commons.net.ntp;
 
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
 import java.net.DatagramPacket;
 
 import org.junit.Assert;
 import org.junit.Test;
+import org.junit.jupiter.api.function.Executable;
 
 public class TestNtpPacket {
 
@@ -150,10 +153,9 @@ public class TestNtpPacket {
         Assert.assertEquals(4, message.getMode());
     }
 
-    @Test(expected=IllegalArgumentException.class)
     public void testCreateFromNullPacket() {
         final NtpV3Packet message = new NtpV3Impl();
-        message.setDatagramPacket(null);
+        assertThrows(IllegalArgumentException.class, () -> 
message.setDatagramPacket(null));
     }
 
     @Test

Reply via email to