From dfc40c064543be6eea99940a61b3764c8b5a41da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=B8=85?= <62982788+597365581@users.noreply.github.com> Date: Sat, 30 Jan 2021 14:54:00 +0800 Subject: [PATCH] Update ShellCommandExecutorTest.java add unit test --- .../server/worker/shell/ShellCommandExecutorTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/shell/ShellCommandExecutorTest.java b/dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/shell/ShellCommandExecutorTest.java index a59fdf8d03..1e93a0df39 100644 --- a/dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/shell/ShellCommandExecutorTest.java +++ b/dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/worker/shell/ShellCommandExecutorTest.java @@ -121,9 +121,10 @@ public class ShellCommandExecutorTest { try { Object instance = shellCommandExecutorClass.newInstance(); - Method method = shellCommandExecutorClass.getDeclaredMethod("parseProcessOutput", new Class[]{}); + Method method = shellCommandExecutorClass.getDeclaredMethod("parseProcessOutput", new Class[]{Process.class}); method.setAccessible(true); - ShellCommandExecutor result = (ShellCommandExecutor) method.invoke(instance, new Object[]{}); + Object arg1s[] = {PowerMockito.mock(Process.class)}; + ShellCommandExecutor result = (ShellCommandExecutor) method.invoke(instance, arg1s); } catch (Exception e) { logger.error(e.getMessage()); }