You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2022/10/22 13:11:53 UTC

[GitHub] [commons-exec] garydgregory commented on a diff in pull request #72: JUnit5 assertThrows DefaultExecutorTest

garydgregory commented on code in PR #72:
URL: https://github.com/apache/commons-exec/pull/72#discussion_r1002467420


##########
src/test/java/org/apache/commons/exec/DefaultExecutorTest.java:
##########
@@ -118,13 +120,14 @@ public void testExecuteWithWorkingDirectory() throws Exception {
         assertEquals(exec.getWorkingDirectory(), workingDir);
     }
 
-    @Test(expected = IOException.class)
+    @Test
     public void testExecuteWithInvalidWorkingDirectory() throws Exception {
         final File workingDir = new File("/foo/bar");
         final CommandLine cl = new CommandLine(testScript);
         exec.setWorkingDirectory(workingDir);
 
-        exec.execute(cl);
+        final Executable testMethod = () -> exec.execute(cl);

Review Comment:
   Why do need local variables for Executables? I would inline these.



-- 
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: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org