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/26 20:26:50 UTC

[commons-vfs] branch master updated: JUnit5 assertThrows SftpFileSystemGroupsTests (#323)

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-vfs.git


The following commit(s) were added to refs/heads/master by this push:
     new 14c301a7 JUnit5 assertThrows SftpFileSystemGroupsTests (#323)
14c301a7 is described below

commit 14c301a75585622e2d108579c3b7010f768b443a
Author: John Patrick <14...@users.noreply.github.com>
AuthorDate: Sat Nov 26 20:26:46 2022 +0000

    JUnit5 assertThrows SftpFileSystemGroupsTests (#323)
---
 .../commons/vfs2/provider/sftp/SftpFileSystemGroupsTests.java      | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystemGroupsTests.java b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystemGroupsTests.java
index 82a76603..49074d31 100644
--- a/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystemGroupsTests.java
+++ b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystemGroupsTests.java
@@ -16,6 +16,8 @@
  */
 package org.apache.commons.vfs2.provider.sftp;
 
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
 import com.jcraft.jsch.JSch;
 import com.jcraft.jsch.JSchException;
 import com.jcraft.jsch.Session;
@@ -56,9 +58,10 @@ public class SftpFileSystemGroupsTests {
         Assert.assertArrayEquals(new int[]{1, 22, 333, 4444}, groups);
     }
 
-    @Test(expected = NumberFormatException.class)
+    @Test
     public void shouldThrowOnUnexpectedOutput() {
         final StringBuilder builder = new StringBuilder("abc\n");
-        fileSystem.parseGroupIdOutput(builder);
+        assertThrows(NumberFormatException.class, () -> fileSystem.parseGroupIdOutput(builder));
     }
+
 }