You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by le...@apache.org on 2021/09/27 08:08:56 UTC
[dolphinscheduler] branch dev updated: add mock getTaskLogName()
for UT test pass (#6369)
This is an automated email from the ASF dual-hosted git repository.
leonbao pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/dev by this push:
new 545173f add mock getTaskLogName() for UT test pass (#6369)
545173f is described below
commit 545173faa31e477f9487e98611f1951cf43efa2b
Author: 百岁 <mo...@126.com>
AuthorDate: Mon Sep 27 16:08:49 2021 +0800
add mock getTaskLogName() for UT test pass (#6369)
---
.../java/org/apache/dolphinscheduler/plugin/task/tis/TISTaskTest.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-tis/src/test/java/org/apache/dolphinscheduler/plugin/task/tis/TISTaskTest.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-tis/src/test/java/org/apache/dolphinscheduler/plugin/task/tis/TISTaskTest.java
index 814f401..adbeb36 100644
--- a/dolphinscheduler-task-plugin/dolphinscheduler-task-tis/src/test/java/org/apache/dolphinscheduler/plugin/task/tis/TISTaskTest.java
+++ b/dolphinscheduler-task-plugin/dolphinscheduler-task-tis/src/test/java/org/apache/dolphinscheduler/plugin/task/tis/TISTaskTest.java
@@ -56,6 +56,7 @@ public class TISTaskTest {
String taskParams = "{\"targetJobName\":\"mysql_elastic\"}";
taskExecutionContext = Mockito.mock(TaskRequest.class);
+ Mockito.when(taskExecutionContext.getTaskLogName()).thenReturn("tislogger");
Mockito.when(taskExecutionContext.getTaskParams()).thenReturn(taskParams);
Mockito.when(taskExecutionContext.getExecutePath()).thenReturn("/tmp");
Mockito.when(taskExecutionContext.getTaskAppId()).thenReturn(UUID.randomUUID().toString());
@@ -68,8 +69,7 @@ public class TISTaskTest {
Map<String, String> gloabParams = Collections.singletonMap(TISTask.KEY_POOL_VAR_TIS_HOST, "127.0.0.1:8080");
Mockito.when(taskExecutionContext.getDefinedParams()).thenReturn(gloabParams);
- tisTask = PowerMockito.spy(new TISTask(taskExecutionContext));
- //tisTask = new TISTask(taskExecutionContext);
+ tisTask = new TISTask(taskExecutionContext);
tisTask.init();
}